NextJS message app
Getting Started
To get started, simply clone the repository and run npm install
# Clone the repo
git clone https://github.com/nolawi/nextjs-message-app.git
# Move into the new directory
cd nextjs-message-app/
# Install npm packages
npm install
# Start up the next.js dev server, browse to http://localhost:3000/
npm start
Todo
- figure out what nextjs does?
- Show form index page
-
/api/guestbook
- fetch
- pages guestbook/ home views
- fetchmessage
- navigation
- bootstrap (bonus)
- Code linting (bonus)
- resets with a success message
- Form/show an error
- Unit tests (bonus)
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.
BONUS
Feel free to add the following
- Add some UI/UX features
- Unit tests (coverage)
- Code linting