Giter Club home page Giter Club logo

node's Introduction

The 3 Minute Node Webserver

boot up an EC2 instance with a node webserver and an HTML5 template in minutes

1. Get EC2 instance with one click

Free 30 minute one click server http://www.instantserver.io

For a more permanent solution check out https://www.digitalocean.com

2. Install node for ubuntu

Reference https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint

$ sudo apt-get update
$ sudo apt-get install python-software-properties python g++ make
optional $ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs

3. Install connect

http://stackoverflow.com/questions/6084360/node-js-as-a-simple-web-server

a) Install connect with NPM

$ npm install connect

b) Create server.js file with this content:

var connect = require('connect');
connect.createServer(
	connect.static(__dirname)
).listen(8080);

c) Run with NodeJS

$ node server.js

4. Copy HTML5 Boilerplate

http://html5boilerplate.com/

Download boilerplate and copy to server

5. Open Website

Open up the server IP in the browser on port 8080

Done!

6. Run the server forever

$ npm install forever -g
$ forever start -l forever.log -o out.log -e err.log server.js 

Make forever start script on reboot $ crontab -u root -e @reboot /usr/lib/node_modules/forever/bin/forever start /root/server.js

node's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.