1.0.2 • Published 6 years ago

nsimplehttp v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

N Simple HTTP

Simple HTTP Server on NodeJS for creating static or real-time projects via Socket.io.

Install

npm install -g nsimplehttp

Start Server

nsimplehttp

or

nsimplehttp dirPublic "your directory without the / at the end"

or

nsimplehttp dirPublic "your directory without the / at the end" serverPort 8080

Run Script in NodeJs

You have complete freedom to expand the script that will run on NodeJs using the path of your Javascript code that will be run internally. To do this, just enter the path in the terminal in the script field to run in the backend. Then export a node module in function form and retrieve the parameters, as in the example below:

modules.export = function(createServer, socket) {

    const io = socket(createServer);
    //Your Code...    
};

Custom Page 404

You have complete freedom to create a 404 page, you do not have to configure anything. Just create a 404.html name file at the root of your project.