Git Product home page Git Product logo

expressjs-study's Introduction

Express JS Study

What is Express JS?

Express is a fast, unopinionated and minimalist web framework for Node.js Express is a “server-side”or “back-end”framework. It is not comparable to client-side frameworks like React, Angular & Vue. It can be used in combination with those frameworks to build full stack applications.

Why use Express JS?
  1. Makes building web applications with Node.js MUCH easier
  2. Used for both server rendered apps as well as API/Microservices
  3. Extremely light, fast and free
  4. Full Control of request and response
  5. By far the most popular Node framework
  6. Great to use with client side frameworks as it’s all JS
What to know first?

JS Fundamental (Objects, Array, Conditionals, etc) Basic Node.js & NPM, HTTP Status Codes, JSON and High Order Array Methods – forEach, map, filter Arrow Functions

Basic server syntax?
const express = require(‘express’);
// Init express
const app = express();
// Create your endpoints/route handlers
app.get(/, function(req. res) {
res.send(‘Hello World’);
});
// Listen on a port
app.listen(5000);
Basic route handling?
App.get(), app.post(), app.put(), app.delete(). Etc
Access to params, query strings, url parts, etc
Express has a router so we can store routes in separate files and export
We can parse incoming data with Body Parser

App.get(/, function(req, res) {
// Fetch from database
// Load Pages
// Return JSON
// Full access to request & response
});

Express Middleware?

Middleware functions are functions that have access to the request and response object. Express has built in middleware but middleware also comes from 3rd party packages as well as custom middleware.

• Execute any codes

• Make changes to the request/response objects

• End response cycle

• Call next middleware in the stack


Tools

Install Postman, an API Development tool for testing purpose.

Install

run npm install

Run

node index

expressjs-study's People

Contributors

aloptrbl 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.