Question: I have an application written on angularJS and built by grunt. Is there a way I can create a http server from node js and host it there. Please share any code snippet or document which would help. Thanks

Answer: 
1. (simplest) if you don't have any server side logic, you can simply serve client side AngularJS/HTML/css via http-server module from npm.
<https://www.npmjs.com/package/http-server>
Just install it via 
$>npm install -g http-server
and go to your client folder, type http-server and hit enter.
2. If you have server side code written, (ExpressJS or restify web api) then use $>nodemon server.js
3. If you are looking at options for production applications, consider forever/pm2
<https://www.npmjs.com/package/pm2>
<https://www.npmjs.com/package/forever>
This example work for me with any case

Eeven if you have base-url or not

[**source code here**](https://github.com/almgwary/nodejs-tricks/blob/master/node-angular-server.js)

```js
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
/**
 * This server should host angular appliation with or without base-url
 * The angular static resources should be under `./public`
 */
var app = express();
app.use(function(req, res, next) {
  console.log('Time:', Date.now() + ":", req.originalUrl)
  next()
})
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
  extended: false
}));
app.use(express.static(path.join(__dirname, 'public')));
app.use('/base-here-if-any', express.static(path.join(__dirname, 'public')))

app.get('*', function(req, res, next) {
  //Path to your main file
  res.status(200).sendFile(path.join(__dirname + '/public/index.html'));
});

const port = 3000

app.listen(port, () => console.log(`Example app listening on port ${port}!`))
```