Skip to content

brendonbrds/node-localhost-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Localhost Server

A Node.js server for localhost environment.

Dependencies

  1. Node.js
  2. npm

Installation

$ cd node-localhost-server
$ npm install
$ node server.js

Now the localhost already started using ports 80 and 443.

Configuration

Inside the root directory, there is a directory named projects. This directory is where you will put all your projects.

You can still configure vhosts (see server.js with examples). Don't forget to configure your hosts file like:

# LOCALHOST
127.0.0.1 example.com example.com.br

Problems with ports

If you have some problems with ports on Linux, you can run:

# Enable your user to run node apps on the default HTTP port (80)
$ sudo apt-get install libcap2-bin
$ sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``

Consider use PM2

You can start the server with:

$ pm2 start server.js

References

About

A Node.js server for localhost environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.6%
  • HTML 15.4%