Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build Your Cool REST API using Node.js

Build Your Cool REST API using Node.js

Node.js Introduction, Asynchronous Programming, Basic HTTP Concept, Basic MariaDB Integration, and REST API Concept

More Decks by Harits Fahreza Christyonotoputra

Other Decks in Programming

Transcript

  1. • Cross-platform Javascript runtime environment • First authored by Ryan

    Dahl, first release in May 27, 2009 (almost 10 years) • Event-driven architecture capable of asynchronous I/O • Official Website https://nodejs.org • Open Source (MIT License) and Totally Free!
  2. The question is ... • Build HTTP Server to Upload

    and Show Image ◦ POST /images ◦ GET /images/{image-name} • Arguments : [1] : HTTP Port [2] : Our local directory to keep the images • Clue : ◦ `npm install formidable` ◦ `Content-Type: application/x-www-form-urlencoded`
  3. But wait, what is NPM? • Node.js Package Manager •

    Official Website https://www.npmjs.com/ • Find or Publish your cool packages in here!
  4. The Guiding Principle • Client-Server • Stateless • Cacheable •

    Uniform Interface • Layered System • Code on Demand
  5. The question is ... • Build REST API to manage

    your daily activity ◦ POST /activities ◦ GET /activities/{date} ◦ GET /activities (group by date) ◦ PUT /activities/:id (Update daily activity) ◦ DELETE /activities/:id • Must use Express.js and database integration • Arguments : [1] : HTTP Port
  6. What you are going to build? • Maximum 3 team

    members • Build anything that you want, your hobbies, office works, the next unicorn idea (?) • Show us what you got! (but still using Node.js, Express.js and MySQL) • Prepare your presentation and demo for 10 minutes and 5 minutes QnA • Make sure all of your code running well • Please put your source code in GitHub account