Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.61 KB

File metadata and controls

41 lines (25 loc) · 1.61 KB

MIT License

About The Project

Basic http and file-based routing implementation using node core modules. Made for academic purposes to demonstrate what happens behind the scenes of libraries that work with HTTP (ExpressJs).

This project follows the old way of serving views with response headers (HTML only). Routes is based on .js files inside /routes folder. root.js folder is equivalent to / path.

Files

  • main.js - main file that boots the server and listens to port 3000
  • router.js - main router logic, it executes the correct route module based on request.
  • routesHandler.js - handles the file logic on /routes folder. It is the responsible for returning the correct file based on url.
  • /routes - directory where route files resides. Files inside will be executed once a HTTP request url match a file name. root.js is equivalent to / route.

Built With

Usage

To run, simply cd to the directory where main.js resides and enter node main.js

Roadmap

  • Make routesHandler serve HTML files instead of .js files. (Server-side rendering)
  • Request body buffer parser
  • Typescript version
  • To be continued

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)