Skip to content

Commit

Permalink
Adjust info on subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Sep 10, 2024
1 parent e12006e commit d46e8cf
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<cid>.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://<cid>.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.

0 comments on commit d46e8cf

Please sign in to comment.