Created
December 29, 2019 18:47
-
-
Save just-Bri/2ac13f26c6d00466c50972b9dc5ecf61 to your computer and use it in GitHub Desktop.
Spaced Rep API Qs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Which database tables are created in the migrations? | |
2. What are the endpoints for user registration, login and refresh? | |
3. What endpoints have been implemented in the language router? | |
4. What is the async and await syntax for? (Hint) | |
5. Which endpoints need implementing in the language router? | |
6. How does the GET /api/language endpoint decide which language to respond with? (Hint: Does it relate to the user that made the request?) | |
7. In the UserService.populateUserWords method, what is db.transaction? | |
- Hints: | |
- https://knexjs.org/#Transactions | |
- https://knexjs.org/#Builder-transacting | |
- https://www.postgresql.org/docs/8.3/tutorial-transactions.html | |
- https://www.tutorialspoint.com/postgresql/postgresql_transactions.htm | |
8. What is SERIAL in the create migration files? (Hint: http://www.neilconway.org/docs/sequences/) | |
9. What is setval in the seed file? (Hint: https://www.postgresql.org/docs/8.2/functions-sequence.html) |
Author
just-Bri
commented
Dec 29, 2019
- user, language, word
- /auth/token, /user, auth/token
- get/, get/head, post/guess
- running code asynchronously(not holding up the stack/queue)
- /language/head and /language/guess
- language id associated with the user
- transaction is kind of like a begin/end for psql, if something goes wrong it will rollback changes.
- auto-inc id
- its used in creating a sequence, in our case the next word etc in the database.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment