Giter Site home page Giter Site logo

wildenali / expressjs-crashcourse Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.87 MB

Latihan ExpressJS dari youtube channel Traversy Media https://www.youtube.com/watch?v=L72fhGm1tfE&list=PLZlQKKTJoway8tq7SaWmKGy2Nlzespuyd&index=4

JavaScript 67.15% HTML 10.21% CSS 0.98% Handlebars 21.66%

expressjs-crashcourse's Introduction

Express JS Basic

  1. Install package $ npm init
  2. Install express $ npm i express
  3. Create server file
  4. How to run $ node index, index because the file
  5. Install nodemon $ npm i -D nodemon, nodemon ini supaya kita tidak perlu nge restart si server filenya, jadi tinggal refresh page aja, pakai nodemon hanya untuk develop not for production
  6. run pakai nodemon $ npm run dev
  7. Coba
  1. Test Api, buka postman
  • Pastikan pada GET request
  • Masukan http://localhost:5000/api/members
  1. Cek middleware
  • Masukan http://localhost:5000/api/members di postman
  • Cek di console, harusnya keluar 'Helow'
  1. Cek url
  1. Install moment $ npm i moment Cek moment (waktu)
  1. Get Single Member Test
  1. Create Member
  • Install npm i uuid

  • Test nya

  • Setup postman sebagai POST method

  • Masukkan http://localhost:5000/api/members

  • Pilih Body, setelah itu kemudian pilih raw

  • Masukkan

{
	"name": "Jake Smitsh",
	"email": "[email protected]"
}

di raw tersebut

  • Click Send
  • Cek Hasilnya di Body > Pretty bagian bawah postman
  1. Update Member
  • Test nya

  • Setup postman sebagai PUT method

  • Masukkan http://localhost:5000/api/members/1

  • Pilih Headers

  • Isi colomn pertama pada KEY dengan Content-Type

  • Isi colomn pertama pada VALUE dengan application/json

  • Pilih Body, setelah itu kemudian pilih raw

  • Masukkan

{
	"email": "[email protected]"
}

di raw tersebut

  • Click Send
  • Cek Hasilnya di Body > Pretty bagian bawah postman
  1. Delete Member
  • Test nya

  • Setup postman sebagai DELETED method

  • Masukkan http://localhost:5000/api/members/1

  • Click Send

  • Cek Hasilnya di Body > Pretty bagian bawah postman

  1. Membuat Template
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">

expressjs-crashcourse's People

Contributors

wildenali avatar

Watchers

 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.