From d46e8cf6aef70e5349d0004a15c4a724bf3c7325 Mon Sep 17 00:00:00 2001 From: Vladimir Grichina Date: Tue, 10 Sep 2024 16:07:21 -0700 Subject: [PATCH] Adjust info on subdomains --- README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a0b3367..f075117 100644 --- a/README.md +++ b/README.md @@ -81,24 +81,30 @@ https://ipfs.web4.near.page/ipfs/bafybeiepywlzwr2yzyin2bo7k2v5oi37lsgleyvfrf6erj https://ipfs.web4.near.page/ipfs/bafybeidg3ohf4kscsf6cjbgg7vttcvu7q4olena3kwhpl5wl3trhhougyi/dist/ -## Subdomain Support +### Subdomain Support -NEARFS now supports accessing content via subdomains. This allows to serve full websites via NEARFS gateway with isolated security context. +NEARFS supports accessing content via subdomains. This allows serving full websites via NEARFS gateway with isolated security context. -### How it works +#### How it works - The gateway checks if the hostname contains a subdomain. - If the subdomain is a valid CID, it serves the content associated with that CID. - The path after the domain is treated as the path within the IPFS directory structure. -### Examples +#### `GET http://.ipfs.web4.near.page/` -You can access IPFS content using subdomains like this: +Returns the content of the root directory for the given CID. -- `http://bafybeicit72w2sl3agal2jftpkrzwd773fjgdk4dym7pq2pbojyif72v5e.ipfs.web4.near.page/` - This serves the content of the root directory for the given CID. +**Example:** + +http://bafybeicit72w2sl3agal2jftpkrzwd773fjgdk4dym7pq2pbojyif72v5e.ipfs.web4.near.page/ + +#### `GET http://.ipfs.web4.near.page/:path` + +Returns the file at the specified path within the directory structure of the given CID. + +**Example:** -- `http://bafybeiepywlzwr2yzyin2bo7k2v5oi37lsgleyvfrf6erjvlze2qec6wkm.ipfs.web4.near.page/privacy.html` - This serves the `privacy.html` file within the directory structure of the given CID. +http://bafybeiepywlzwr2yzyin2bo7k2v5oi37lsgleyvfrf6erjvlze2qec6wkm.ipfs.web4.near.page/privacy.html This feature provides a more intuitive way to share and access IPFS content through the NEARFS gateway.