A basic boilerplate for nextjs challenge
You are responsible for writing a node app using nextjs. Your app will consist of two pages (a form, and a feed), and a server that reads and writes to the feed.
Challenge: Create a new Github project with NextJS and React that meets the following criteria:
- Starts with the command
npm i && npm dev
- Shows a form with “name” and “message” when it runs at localhost:3000
- When submitting form, runs a
POST
to/api/guestbook
and resets with a success message (should show an error if things are missing). - A link on the homepage takes you to
/guestbook
and shows all posts that have been submitted from the previous form.
- A link on that page exists to go back to the homepage
- You do not need to persist that data in any database, just keep it in memory.
Feel free to add the following
- Add some UI/UX features
- Unit tests (coverage)
- Code linting