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

POST /page/{projid} route and test #22

Open
thehabes opened this issue Feb 1, 2024 · 0 comments
Open

POST /page/{projid} route and test #22

thehabes opened this issue Feb 1, 2024 · 0 comments
Labels
route An endpoint available to TPEN interfaces. tiny-tpen This issue requires interaction with the RERUM API through Tiny TPEN tpen-static This issues requires interaction with the TPEN static repository

Comments

@thehabes
Copy link
Member

thehabes commented Feb 1, 2024

The application needs to add POST method handling to the /page route. The endpoint will be handed a JSON object that represents a Canvas (page) to be included in a project. The URL will include the project id. For example:

POST {"title":"My Page"}
http://localhost:3001/page/{projid}

Then endpoint will do various bits of logic (TBD at a later time) and ultimately return a JSON Object representing a page (Canvas).

This endpoint requires authentication and so will need to process a user and user permissions from the Authorization header's Bearer Token which came is as part of the request. If this header is not present or is invalid the endpoint should respond 401 Unauthorized.

This route will need CORS headers as described by #9.

Tests could include

  • Is the route registered with the app
  • Does the route process the existence and lack of the {id} section of the request
  • When there errors in the request pattern, are they caught and do they elicit a RESTful response
  • Does the route return the expected object type
  • Does it succeed an end-to-end request
@thehabes thehabes added tiny-tpen This issue requires interaction with the RERUM API through Tiny TPEN tpen-static This issues requires interaction with the TPEN static repository route An endpoint available to TPEN interfaces. labels Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
route An endpoint available to TPEN interfaces. tiny-tpen This issue requires interaction with the RERUM API through Tiny TPEN tpen-static This issues requires interaction with the TPEN static repository
Projects
None yet
Development

No branches or pull requests

1 participant