Archive

Posts Tagged ‘HTML’

Setup a Javascript server for running angular app using st package

May 31, 2018 Leave a comment

If you need a Javascript web server to run angular apps. Please follow the below steps.

1. Install node.

2. Go to the working directory and install st package (https://www.npmjs.com/package/st)

12

3. Create a server.js file in the working directory with the following code

var st = require('st')
var http = require('http')
http.createServer(st({path:process.cwd(),cache:false})).listen(1337)
console.log('Running server at localhost:1337/')

 

4. Run the server.js using node

13

5. Create an index.html file in the working directory and check the server path

15

14

Happy coding 🙂