https://github.com/mraza007/express-api
This repo contains Todo-api built with ExpressJS
https://github.com/mraza007/express-api
Last synced: 4 months ago
JSON representation
This repo contains Todo-api built with ExpressJS
- Host: GitHub
- URL: https://github.com/mraza007/express-api
- Owner: mraza007
- Created: 2018-10-02T04:04:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-07T02:14:54.000Z (over 7 years ago)
- Last Synced: 2025-04-19T02:54:54.632Z (9 months ago)
- Language: JavaScript
- Size: 2.13 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Building JSON Api with Node and Mongo
This is a simple demonstrate how to build api using Node and Mongo.
In this I will be building A simple todo api.
## Defining Routes
- **GET** `/api/todos` List All Todos
- **POST** `api/todos` Create New Todo
- **GET** `api/todos/todoId` Retrieve a Todo
- **UPDATE** `api/todos/todoId` Update Todo
- **DELETE** `api/todos/todoId` Delete a Todo
## MongoDB Schema (Structing Todo Data)
- name `(type:string)`
- complete `(type:Boolean)`
- createdDate `(type:Date)`
## Getting Started with installation
- Make sure we have node installed.
- run `npm init` this will initialize.It contains meta data of our project
- install express js using `npm install express`.
- create a main file `touch index.js`.
- set up express in the file
- everything else will be in the `index.js` file