ajsaenz1091 / express-ztm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express.js

Express.js NodeJS

GitHub language count Profile View Counter

About

I created this application to practice NodeJS and ExpressJS. The app is organized using the MVC model, it renders templates using a template engine called hbs(Handlebars.js).

The main concepts practiced in this app were:

  1. How to create an Express.js server
  2. Middleware
  3. Routing in Express.js
  4. The MVC design pattern
  5. Server side rendering
  6. Separation of concerns
  7. RESTful API convention

Run locally

In order to run this app locally, make sure you clone this repository in your local machine. Instructions to clone a repo. Once you cloned the repository, navigate to the project folder and download the dependencies (all the packages listed in the package.json file necessary for the app to run) by running: npm install. At this point the app should be ready to run, which you can do with the following command npm start.

You'll know the server is running when you see this in your terminal:

Testing endpoints

Once you have the server up and running, you can visit localhost. You can make two types of request, GET and POST.

GET

get-friends

get-friend pass a number from 0 to 3 to get a different friend

get-messages

POST

To make POST requests I use a tool called Postman

Post friend

Post messages

Again, this is a backend application so the views rendered to the client(front-end) are very simple.

About


Languages

Language:JavaScript 90.9%Language:Handlebars 6.9%Language:CSS 2.2%