A client has asked you to create an app that operates as a competitor to Elfster. They're a company valued at $6 million that creates gift exchanges for families and friends.
Your client thinks they have a few killer features that could improve on Elfster's design and allow them to compete in the market. But first, they need a backend product to work with. They'd like you to build the prototype using Node and Express.
Run npm install
to install required dependencies, then npm start
to start the server.
- Create the Express application and wire up the middleware should be written in the
app.js
file - Code to run the API located in the
server.js
file, where it should import the Express application from theapp.js
code and then make sure it listens on port3000
. - A
GiftExchange
model that implements two different gift-exchange algorithms. - An Express router living at the
/gift-exchange
endpoint to handle requests for the two different algorithms - Logging and error-handling middleware to enable more seamless interaction with the API
- Implement a
/quiz
endpoint that respondsGET
requests with quiz questions for the user to answer - Implement a
/quiz
endpoint that responds toPOST
requests with results for the user's quiz answers - Implement a
quizResult
function in theGiftExchange
model that calculates a score based on the user's input and responds with a type of gift that the user might enjoy