Setting up the SQS
Our next order of business is setting up the server that handles the requests from one or more clients. This will be a small standalone application and it will get its data from our Nuxt server since that already has a connection with the database instance. Creating an endpoint in Nuxt is something we haven’t built yet because our Nuxt application is only capable of presenting a management app!
Nuxt API routes
As I mentioned previously, the Nuxt app runs as a Node process. When we request pages, it acts as a web server that interprets the Vue components and routes to return an HTML response. In addition to that, it can also act as a server at the same time! Nuxt uses the Nitro server engine (https://nuxt.com/docs/guide/directory-structure/server) to process requests on scripts in the ./server
folder. It also supports file-based routing and parameters, similar to the ./
pages
folder.
To server our quizzes as part of a RESTful API, we’ll create...