Custom Search

Friday, April 26, 2019

How to Create Simple Web Server with Node.js

1)
ionic build browser --prod

2)
cd www

3)
npm install connect serve-static

4)
vim server.js
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080)

5)
node server.js

6)
http://127.0.0.1:8080

No comments:

Post a Comment