A Guestbook web application.
- users can submit and view messages. Built with Node.js, Express, and MongoDB.
-
Clone the Repository:
git clone <your-repo-link> cd <repository-folder>
-
Install Dependencies:
npm install
-
Setup Environment Variables: Create a
.envfile and add your MongoDB URI:MONGODB_URI=mongodb+srv://your-username:your-password@cluster0.yvvnn.mongodb.net/guestbook?retryWrites=true&w=majority
-
Start the Server:
npm start
-
Open the App: Go to
http://localhost:3000in your browser.
- Endpoint:
POST /api/message - Description: Adds a new message to the guestbook.
- Request Body:
{ "name": "John Doe", "message": "Hello, world!" } - Response:
{ "message": "Message added successfully" }
- Endpoint:
GET /api/messages - Description: Retrieves all guestbook messages.
- Response:
[ { "name": "John Doe", "message": "Hello, world!", "timestamp": "2024-02-01T12:34:56Z" } ]
- Deployed API: https://api-dev-7m55.onrender.com
- Deployed Website: api-guestbook.netlify.app (WIP)