Skip to content

robin-dc/Custom-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

ECOMMERCE SERVER : OVERVIEW

I was fascinated that I created my own server that runs like the live server extension of vscode. With this custom activity that I made, I apply my knowledge with HTML Templating as well as making Route Handlers and some basic stuffs like advance array methods and POJO manipulation. I was also introduce with new packages namely http and fs modules.

  1. Create a server directory
  2. Inside the server folder, create 2 folders
    • assets <= this is where css or image files will be stored
    • views <= this is where html documents will be stored
  3. Create a file server.js
  4. cd into the server directory
  5. npm init -y <= creates package.json
  6. Import modules
    • const http = require('http'); <= Creates a server
    • const fs = require('fs'); <= Reads a file and convert it into string