Coder Social home page Coder Social logo

list-api's Introduction

list-api

This is a basic REST API made using Node.JS, Express, and MongoDB.

How to use this?

Clone the repository. Install mongodb on your machine, using the instructions found here. (If you are on Windows you may need to edit your path variables to allow mongo/mongod to be run from the command line.)

run $ npm install in the root of the repository.

Create a directory named 'data' within the root of the repository, then a subdirectory called 'db'.

Open a command prompt at the root of your directory, and type the following command: $ mongod --dbpath .\data\db If you installed mongodb correctly, you will receive a lot of logs to the console, the process will stay running.

Open a new command prompt (leave the old running) in the new one, start your server using: $ node server.js

You should get a response "We are live on 8000." This is the port set in your server.js file.

#REST You can make HTTP requests to localhost:8000/notes.

GET: http://localhost:8000/notes will return all notes in the notes list.
POST: http://localhost:8000/notes your content type should be application/json and your body should include an object with {"text":[your text],"title":[your title]}.
GET: http://localhost:8000/notes/[noteid] will return the note with the given id.
PUT: http://localhost:8000/notes/[noteid] same as post, but your body may include text and/or title key value pairs.
DELETE: http://localhost:8000/notes/[noteid] will delete the note with the id specified.

list-api's People

Contributors

bobbymcwho avatar

Watchers

James Cloos avatar  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.