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

merge all web routes calling seneca into a limited number of endpoints #7

Open
rjrodger opened this issue Aug 5, 2021 · 3 comments

Comments

@rjrodger
Copy link
Contributor

rjrodger commented Aug 5, 2021

say /api/msg, which accepts a POST of a JSON object - the seneca message
this will be compatible with seneca-browser (which we will need to use)
authentication and authorization to be handled by seneca plugins exposing express middleware

@rjrodger rjrodger changed the title merge all web routes calling seneca into a single endpoint merge all web routes calling seneca into a limited number of endpoints Aug 9, 2021
@rjrodger
Copy link
Contributor Author

rjrodger commented Aug 9, 2021

Actually two:
/api/public - public messages - e.g search
/api/account - private - requires login

use express end points for these

accept whatever JSON is sent, call seneca.act, send back response

@rjrodger
Copy link
Contributor Author

rjrodger commented Aug 9, 2021

security: seneca-browser will help - leave it for later
(we will namespace and mark the messages)

@rjrodger
Copy link
Contributor Author

rjrodger commented Aug 9, 2021

errors:

  • system - something broke - use HTTP codes
    • also req against /api/account with no login - 401
  • business - login failed, wrong input etc, that's still 200, SJON response encodes whatever the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant