Skip to content

martinalee94/node-crash-course

Repository files navigation

Node crash course

- Overview

  • A simple blog page in Nodejs, MongoDB and EJS(Server-side rendering)

- Screenshots

1. Homepage(index)

  • This page shows the list of all contents.
index

2. Blog post detail page

  • Users are able to read the detail of a post and delete the current post.
detail

3. Create a new blog post page

  • Users are able to create a new post with title, snippet and body.
write

TOC

1-2. Introduction & Setup

3. Clients and Servers

  • How to create a server in Node

4. Requests and Responses

  • How to customize req and res in Node
  • Simple practice of creating response and routing

5. NPM

  • We can install third-party packages via NPM.
  • Install Nodemon globally, which is a package for restarting server automatically
  • Package.json file(npm init)
  • lodash package(npm install lodash)

6. Express

  • npm install express

7. View Engines

  • EJS
  • In html, <% %> or <%= value %> <%- include %>works for EJS

8. Middleware

  • The order of middleware is important
  • Logger middleware, Authentication middleware, Parsing JSON.... etc.
  • 3rd party middleware package - ex) morgan - logger
  • static files middleware(express.static)

9. MongoDB

10. Get, Post, Delete Requests

  • Route parameters(ex. localhost:3000/blogs/:id)
  • EJS Beautify formatter

11. Express router & MVC

  • Express router
  • Model, View, Controller -> keeps code more modular and reusable

Youtube : https://youtu.be/zb3Qk8SG5Ms

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published