Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket mapping #295

Merged
merged 3 commits into from
Oct 26, 2018
Merged
Changes from 1 commit
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 us possibility bypass preflighted requests in CORS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the dots at the end of sentences?

Maybe something more like:
"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.

For example:
->
"


``` 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
```