Griffin webserver v2 Example

Basic webserver library to serve files in a folder.

But can also have specific paths like /api/ that is handled by custom function, and the need for that was why this was created in the first place.

Basically this library is perfect for projects that is rest backend, and static served files as frontend.

For instance a searchengine where you need a webpage that pull data from the backend.


It don't contain bells and whistles, it's just quick and only uses vanilla nodejs so no need to install external libraries.

Also note that its currently just 250 lines of code, of them 68 are defining mime types, and 54 lines of comments or empty lines, it's very lightweight in every sense of the word.


This is a example file, you most likely have

      
const Webserver = require('griffinwebserver_v2');
const webserver = new Webserver('www/', 8080);
rather than
const Webserver = require('griffinwebserver_v2');
const webserver = new Webserver(path.join(__dirname, 'www/'), 8080);

And thereby using the folder of the npm package + www