Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. Frontend:
  2. Which routes are already set up and what are their paths?
  3. <PrivateRoute
  4. exact
  5. path={'/'}
  6. component={DashboardRoute}
  7. />
  8. <PrivateRoute
  9. path={'/learn'}
  10. component={LearningRoute}
  11. />
  12. <PublicOnlyRoute
  13. path={'/register'}
  14. component={RegistrationRoute}
  15. />
  16. <PublicOnlyRoute
  17. path={'/login'}
  18. component={LoginRoute}
  19. />
  20. <Route
  21. component={NotFoundRoute}
  22. />
  23.  
  24. What is the concern of the AuthApiService object?
  25. AuthApiService has postUser (sends user), postLogin(sends username and password) refreshToken(refreshes the token
  26. keeping user logged in)
  27.  
  28. What is the concern of the UserContext?
  29. json web token cases
  30. saveAuthToken(token: any)
  31. getAuthToken()
  32. clearAuthToken()
  33. hasAuthToken()
  34. parseJwt(jwt: any)
  35. parseAuthToken()
  36. _getMsUntilExpiry(payload: any)
  37. queueCallbackBeforeExpiry(callback: any)
  38. clearCallbackBeforeExpiry()
  39. If a user is inactive for a sometime the token won't be refreshed and will automatically log them out.
  40.  
  41. Does the PrivateRoute make use of the UserContext?
  42. privateRoute only allows users who are logged in, so it's in the userContext because of the jwt
  43.  
  44. What does the /cypress/integration/day-0.1-purpose.spec.js file test?
  45. tests if the application has a h1 with a title
  46.  
  47. Which elements on the page are being checked in and what for?
  48. the header is being checked for an h1 to contain the title Spaced repitition
  49. the p expected specific text inside.
  50.  
  51.  
  52. Backend:
  53. Which database tables are created in the migrations?
  54. language, user, word
  55.  
  56. What are the endpoints for user registration, login and refresh?
  57. user endpoint: /api/user
  58.  
  59. What endpoints have been implemented in the language router?
  60. language endpoints: /api/language
  61. get all words for a specific language
  62. two routes that need to be finished
  63.  
  64. What is the async and await syntax for?
  65. The word “async” before a function means one simple thing: a function always returns a promise.
  66. Other values are wrapped in a resolved promise automatically.
  67.  
  68. The keyword await makes JavaScript wait until that promise settles and returns its result.
  69.  
  70. await can only be used inside an async function
  71.  
  72. Which endpoints need implementing in the language router?
  73. /head which is a get request
  74. /guess which is a post request
  75.  
  76.  
  77. How does the GET /api/language endpoint decide which language to respond with? (Hint: Does it relate to the user that made the request?)
  78. For all /api/language endpoints a call to the db is made to grab the language the user has based
  79. on the id of the user. Then the get language words uses a service that will get the words for the specific language
  80.  
  81. In the UserService.populateUserWords method, what is db.transaction?
  82. All queries within a transaction are executed on the same database connection, and run the entire set of queries as
  83. a single unit of work. Any failure will mean the database will rollback any queries executed on that connection to
  84. the pre-transaction state.
  85.  
  86. What is SERIAL in the create migration files?
  87. Unique identifier columns, sequential, that is automatically assigned.
  88.  
  89. What is setval in the seed file?
  90. Set sequence's current value/ Reset the sequence object's counter value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement