Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions docs/docs/project/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,45 @@ npx s hosting delete <hosting-name>
```
!> After that your Hosting will be deleted from the configuration but folder with files will still be available in your local directory.
Hosting will be removed from your backend during the next `npx s deploy`.


## Socket mapping

Mapping is a configuration of hosting which gives you a possibility to expose Sockets endpoints as a part of the hosting URL. It is also helping to avoid preflighted requests in CORS.

``` yaml
sockets_mapping:
-
- /<socket_name>/<specific_endpoint>
- <socket_name>/<specific_endpoint>
```

For simple description how Socket mapping works let's assume that we have books-library socket with 3 endpoints

``` yaml
# syncano/books-library/syncano.yaml
endpoints:
get-book:
description: get specific book
get-author-books:
description: get all author books
add-new-book:
description: add new book to database
```

``` yaml
# syncano.yaml
hosting:
website:
config:
sockets_mapping:
-
- /books-library/get-book
- books-library/get-book
-
- /books-library/get-author-books
- books-library/get-author-books
-
- /books-library/add-new-book
- books-library/add-new-book
```