SlideShare a Scribd company logo
6
Most read
12
Most read
Tech Talk
Friday, 13 February 2015
Create a RESTful API
Express +
Roadmap
• Express Overview
• MongoDB Overview
• Learn Express Route
• ODM MongoDB with Mongoose
• Handle CRUD for an item
• Use the proper HTTP verbs to make it RESTful (GET,
POST, PUT, and DELETE)
• Return JSON data
Getting Started
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash
$ source ~/.nvm/nvm.sh
$ nvm install v0.10.36
$ nvm alias default 0.10.36
Install and Setup
Install Node.JS using NVM [Node Version Manager] https://github.com/creationix/nvm
Install MongoDB on OS X
Install MongoDB with Homebrew : $ brew install mongodb
http://www.mongodbspain.com/en/2014/11/06/install-mongodb-on-mac-os-x-yosemite/
MongoDB
MongoDB is a document database that provides high
performance, high availability, and easy scalability.
source : http://www.mongodb.org/about/introduction/
Schema Less
Data strore in JSON-like documents with dynamic
Providing flexibity during the development process
Built-in Javascript :)
Create a RESTful API with NodeJS, Express and MongoDB
“Representational State Transfer (REST) is a software
architecture style consisting of guidelines and best practices
for creating scalable web services. REST is a coordinated
set of constraints applied to the design of components in a
distributed hypermedia system that can lead to a more
performant and maintainable architecture.”
http://en.wikipedia.org/wiki/Representational_state_transfer
What is REST
Express Apps
$ npm install
$ node server.js
Express Route
curl -i -X POST -H 'Content-Type: application/json' -d '{}' http://localhost:3000/user
curl -i -X PUT -H 'Content-Type: application/json' -d '{}' http://localhost:3000/user
curl -i -X DELETE -H 'Content-Type: application/json' -d '{}' http://localhost:3000/user
curl -i -X GET http://localhost:3000/user
MongoDB with MongooseJS
$ npm install —save mongoose
Create MongoDB Model
$ git clone git@github.com:aredo/express-rest-api.git
Source Code

More Related Content

What's hot (20)

PDF
Painless JavaScript Testing with Jest
Michał Pierzchała
 
PDF
IIS 7.0 Architecture And Integration With Asp.Net
Manny Siddiqui MCS, MBA, PMP
 
PPTX
React Native and React JS Advantages, Disadvantages and Features.pptx
InnvonixTechSolution
 
PDF
66 pfsense tutorial
equinonesr
 
PPTX
React Native
ASIMYILDIZ
 
PDF
Cv dridi-lotfi
Lotfi Dridi
 
PDF
Cours design pattern m youssfi partie 6 proxy
ENSET, Université Hassan II Casablanca
 
PDF
Dash Intro.pdf
NgoPhuong30
 
PPT
RESTful API In Node Js using Express
Jeetendra singh
 
PPTX
.Net
Gowarthini
 
PDF
OpenESB et BPEL
Lilia Sfaxi
 
PPTX
iOS Keychain 介紹
ShengWen Chiou
 
PDF
spring-boot-fr.pdf
seydou4devops
 
PPTX
Introduction à spring boot
Antoine Rey
 
PPTX
Introduction to Ionic framework
Shyjal Raazi
 
PDF
eServices-Tp1: Web Services
Lilia Sfaxi
 
PDF
Hive
Ines Slimene
 
PDF
Adrián Garrido - 10 Diferencias entre GAU y GA4.pdf
Adrián Garrido
 
PDF
Mobile API: Design & Techniques
Fred Brunel
 
PDF
NextJS - Online Summit for Frontend Developers September 2020
Milad Heydari
 
Painless JavaScript Testing with Jest
Michał Pierzchała
 
IIS 7.0 Architecture And Integration With Asp.Net
Manny Siddiqui MCS, MBA, PMP
 
React Native and React JS Advantages, Disadvantages and Features.pptx
InnvonixTechSolution
 
66 pfsense tutorial
equinonesr
 
React Native
ASIMYILDIZ
 
Cv dridi-lotfi
Lotfi Dridi
 
Cours design pattern m youssfi partie 6 proxy
ENSET, Université Hassan II Casablanca
 
Dash Intro.pdf
NgoPhuong30
 
RESTful API In Node Js using Express
Jeetendra singh
 
OpenESB et BPEL
Lilia Sfaxi
 
iOS Keychain 介紹
ShengWen Chiou
 
spring-boot-fr.pdf
seydou4devops
 
Introduction à spring boot
Antoine Rey
 
Introduction to Ionic framework
Shyjal Raazi
 
eServices-Tp1: Web Services
Lilia Sfaxi
 
Adrián Garrido - 10 Diferencias entre GAU y GA4.pdf
Adrián Garrido
 
Mobile API: Design & Techniques
Fred Brunel
 
NextJS - Online Summit for Frontend Developers September 2020
Milad Heydari
 

Viewers also liked (7)

PDF
Complete MVC on NodeJS
Hüseyin BABAL
 
PDF
Introduction to REST API with Node.js
Yoann Gotthilf
 
KEY
Introduction to node.js
Jakub Nesetril
 
PPT
Nodejs - Building a RESTful API
Sang Cù
 
PDF
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
PPTX
Introduction to node.js GDD
Sudar Muthu
 
PPT
7 Stages of Scaling Web Applications
David Mitzenmacher
 
Complete MVC on NodeJS
Hüseyin BABAL
 
Introduction to REST API with Node.js
Yoann Gotthilf
 
Introduction to node.js
Jakub Nesetril
 
Nodejs - Building a RESTful API
Sang Cù
 
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
Introduction to node.js GDD
Sudar Muthu
 
7 Stages of Scaling Web Applications
David Mitzenmacher
 
Ad

Similar to Create a RESTful API with NodeJS, Express and MongoDB (20)

PDF
RESTful Web API and MongoDB go for a pic nic
Nicola Iarocci
 
PDF
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
PDF
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
PPTX
Building Your First App with MongoDB
MongoDB
 
PDF
Backend Basic in nodejs express and mongodb PPT.pdf
sadityaraj353
 
PDF
API Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015
Hamdi Hmidi
 
PPTX
Node js crash course session 5
Abdul Rahman Masri Attal
 
PPTX
Express JS Rest API Tutorial
Simplilearn
 
PDF
Getting started with node JS
Hamdi Hmidi
 
PPTX
Create Rest API in Nodejs
Irfan Maulana
 
PPTX
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
PPTX
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
PPTX
mern _stack _power _point_ presentation(1)
susmithalanka2
 
PPTX
Webinar: Get Started with the MEAN Stack
MongoDB
 
PPTX
Getting Started with MongoDB using Node.js
Nic Raboy
 
PDF
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
PPTX
MERN_Stack_Project_Tracking_System.pptx.
ManoelOhmogar
 
PDF
Building a REST API with Node.js and MongoDB
VivochaLabs
 
PDF
Build your first MongoDB App in Ruby @ StrangeLoop 2013
Steven Francia
 
RESTful Web API and MongoDB go for a pic nic
Nicola Iarocci
 
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
Building Your First App with MongoDB
MongoDB
 
Backend Basic in nodejs express and mongodb PPT.pdf
sadityaraj353
 
API Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015
Hamdi Hmidi
 
Node js crash course session 5
Abdul Rahman Masri Attal
 
Express JS Rest API Tutorial
Simplilearn
 
Getting started with node JS
Hamdi Hmidi
 
Create Rest API in Nodejs
Irfan Maulana
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
mern _stack _power _point_ presentation(1)
susmithalanka2
 
Webinar: Get Started with the MEAN Stack
MongoDB
 
Getting Started with MongoDB using Node.js
Nic Raboy
 
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 
MERN_Stack_Project_Tracking_System.pptx.
ManoelOhmogar
 
Building a REST API with Node.js and MongoDB
VivochaLabs
 
Build your first MongoDB App in Ruby @ StrangeLoop 2013
Steven Francia
 
Ad

Recently uploaded (20)

PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 

Create a RESTful API with NodeJS, Express and MongoDB

  • 1. Tech Talk Friday, 13 February 2015
  • 2. Create a RESTful API Express +
  • 3. Roadmap • Express Overview • MongoDB Overview • Learn Express Route • ODM MongoDB with Mongoose • Handle CRUD for an item • Use the proper HTTP verbs to make it RESTful (GET, POST, PUT, and DELETE) • Return JSON data
  • 4. Getting Started $ curl https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash $ source ~/.nvm/nvm.sh $ nvm install v0.10.36 $ nvm alias default 0.10.36 Install and Setup Install Node.JS using NVM [Node Version Manager] https://github.com/creationix/nvm Install MongoDB on OS X Install MongoDB with Homebrew : $ brew install mongodb http://www.mongodbspain.com/en/2014/11/06/install-mongodb-on-mac-os-x-yosemite/
  • 5. MongoDB MongoDB is a document database that provides high performance, high availability, and easy scalability. source : http://www.mongodb.org/about/introduction/ Schema Less Data strore in JSON-like documents with dynamic Providing flexibity during the development process Built-in Javascript :)
  • 7. “Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.” http://en.wikipedia.org/wiki/Representational_state_transfer What is REST
  • 8. Express Apps $ npm install $ node server.js
  • 9. Express Route curl -i -X POST -H 'Content-Type: application/json' -d '{}' http://localhost:3000/user curl -i -X PUT -H 'Content-Type: application/json' -d '{}' http://localhost:3000/user curl -i -X DELETE -H 'Content-Type: application/json' -d '{}' http://localhost:3000/user curl -i -X GET http://localhost:3000/user
  • 10. MongoDB with MongooseJS $ npm install —save mongoose
  • 12. $ git clone [email protected]:aredo/express-rest-api.git Source Code