Skip to content

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guestbook App

A Guestbook web application.

  • users can submit and view messages. Built with Node.js, Express, and MongoDB.

Installation Instructions

  1. Clone the Repository:

    git clone <your-repo-link>
    cd <repository-folder>
  2. Install Dependencies:

    npm install
  3. Setup Environment Variables: Create a .env file and add your MongoDB URI:

    MONGODB_URI=mongodb+srv://your-username:your-password@cluster0.yvvnn.mongodb.net/guestbook?retryWrites=true&w=majority
    
  4. Start the Server:

    npm start
  5. Open the App: Go to http://localhost:3000 in your browser.

API Endpoints Documentation

1. Add a Message

  • 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"
    }

2. Get All Messages

  • Endpoint: GET /api/messages
  • Description: Retrieves all guestbook messages.
  • Response:
    [
      {
        "name": "John Doe",
        "message": "Hello, world!",
        "timestamp": "2024-02-01T12:34:56Z"
      }
    ]

Deployment Links

About

Api Development Assignment

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages