In one of the previous chapters of the course material, we mentioned that when your backend server is running in Heroku, it is in production mode. This kind of testing where multiple components of the system are being tested as a group, is called integration testing. Since our application's backend is still relatively simple, we will make the decision to test the entire application through its REST API, so that the database is also included. One library that could be used for this is mongodb-memory-server. In some situations, it can be beneficial to implement some of the backend tests by mocking the database instead of using a real database. The only potential thing we could unit test is the toJSON method that is used for formatting notes. Since the backend does not contain any complicated logic, it doesn't make sense to write unit tests for it. `/auth/$`Ĭonst notes = await $strapi.$notes.We will now start writing tests for the backend. Open up the _provider.js file and add the following code Īccess_token: this.$_token, Building the Nuxt.js frontend to handle redirects Now we should see the Facebook and GitHub icons displayed correctly. Open up your file, and add the following lines of code.In your terminal, execute the following code to install font-awesome yarn add nuxt-fontawesome //using yarn We are also using font-awesome to display icons, let’s see how to do that: When a user clicks on the link, our login logic is ready to execute. In the code above, we create links to our Strapi backend’s Facebook and GitHub logic using tags. cd pagesįill up the login.vue file with the code below Building the Login pageĮxecute the following code to create a login.vue file. With the above code we’ve built the homepage of our notes sharing application, the next task is to build a login page, from which users can login into our application. 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif container min-h-screen flex justify-center items-center text-center mx-auto įont-family: 'Quicksand', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, * Sample `apply` at-rules with Tailwind CSS Share your notes with anybody across the globe Your number one notes sharing application
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |