Skip to content

Simple HTTP and file-based routing implementation using nodejs core modules.

License

Notifications You must be signed in to change notification settings

justintroy/node-corehttp-raw-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Simple HTTP and file-based routing implementation using nodejs core modules.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published