Giter Site home page Giter Site logo

notes-app's Introduction

notes-app

This notes-app is a REST API to :

 -> Create Notes.

 -> Retrieve all existing notes and also notes by  their respective id's.

 -> Update existing notes by their id's.

 -> Delete existing notes by their id's.

Setting up the environment

Clone this repository in your local machine.

(Make sure your machine have node and npm pre-installed before cloning this repository).

REPLACE THE MONGO_URI in .env and docker-compose.yml files by your own MONGO_URI.

NOW YOU ARE GOOD TO GO.

Usage

Running the server on localhost on port 5000.

npm run dev

The server will start running and can be accessed through http://localhost:5000 and get connected to mongoDB database.

API endpoint for creating Notes:

POST: http://localhost:5000/notes/create

API endpoint for retrieving all Notes:

GET: http://localhost:5000/notes

API endpoint for retrieving a Note by it's id:

GET: http://localhost:5000/notes/:id

API endpoint for updating a Note by it's id:

PUT: http://localhost:5000/notes/:id

API endpoint for deleting a Note by it's id:

DELETE: http://localhost:5000/notes/:id

*USE Ctrl+C to stop the server


For building and running Docker containers:

Make sure docker is installed in your local machine before running the below command.

Run this command in the terminal:

sudo docker compose up

The database conatiner along with API container will be build and started.

The server starts running and can be accessed through http://localhost:5001 (as in docker container PORT 5000 is mapped to 5001) and get connected to mongoDB database.

API endpoint for creating Notes:

POST: http://localhost:5001/notes/create

API endpoint for retrieving all Notes:

GET: http://localhost:5001/notes

API endpoint for retrieving a Note by it's id:

GET: http://localhost:5001/notes/:id

API endpoint for updating a Note by it's id:

PUT: http://localhost:5001/notes/:id

API endpoint for deleting a Note by it's id:

DELETE: http://localhost:5001/notes/:id

*USE Ctrl+C to stop and exit the server

Run the below commands to exit and delete the built containers:

sudo docker compose down

NOTE: I have exposed my .env file in github just for the evaluation purpose of Flipr so that nothing goes wrong while cloning and running my REST API and it runs as it is.

This file contains secret credentials and should never be exposed to the public github repositories.

MADE BY AKASH KUMAR

notes-app's People

Contributors

skyxen avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.