This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // I basically made this so that I could divide logical sections of a website into different SPAs for speed without | |
| // serving the entire website up front. This is heavily based on the below article, although I promise I didn't C/P: | |
| // http://adrianmejia.com/blog/2016/08/24/Building-a-Node-js-static-file-server-files-over-HTTP-using-ES6/ | |
| const http = require('http'); | |
| const port = process.argv[2] || 9000; | |
| http.createServer(function (request, result) { | |
| // import the necessary packages | |
| const url = require('url'); | |
| const fs = require('fs'); |
NewerOlder