Coder Social home page Coder Social logo

adhywiranto44 / simple-rest-api Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 25 KB

Project boilerplate untuk membangun REST API menggunakan Node.js, Express, dan Mongodb

JavaScript 99.60% Shell 0.40%
rest-api beginner simple-app nodejs expressjs mongodb

simple-rest-api's Introduction

Simple REST API

Project boilerplate untuk membangun Backend REST API menggunakan Node.js, Express, dan Mongodb.

Studi kasus

Pengelolaan blog

Software yang harus diinstall

  • MongoDB
  • Node.JS
  • Module nodemon yang diinstall secara global
# Routes
GET      /api/posts
POST     /api/posts
GET      /api/posts/:slug
PUT      /api/posts/:slug
DELETE   /api/posts/:slug

Pengingat

  • Jangan lupa jalankan MongoDB mu

Konfigurasi

# Install dependencies
npm install

# Install Nodemon
npm install -g nodemon

# Setup Environment Variable
mv .env.example .env

# Konfigurasi .env
- uncomment DB_NAME
- ganti nama yourDBName sesuai dengan keinginan, misalkan simpleblogDB

# Run
npm start atau nodemon . atau node .

Contoh penggunaan

  • Kamu bisa menggunakan POSTMAN untuk mencoba Endpoints yang tersedia, misalkan untuk menambahkan data dapat menggunakan metode request POST dengan Endpoint http://localhost:3000/api/posts.
  • Setelah itu coba tambahkan data baru di tab Body lalu pilih option x-www-form-urlencoded.
  • Lalu isi form di tabel Key Value dengan data title dan body
  • Send Request

simple-rest-api's People

Contributors

adhywiranto44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.