ionic 发布为webserver

公司在做ionic开发时,遇到要发布为webserver:

1
2
3
$ cd [ionic project]
$ ionic platform add browser
$ cd [ionic project]/platforms/browser/

安装 Install Node.js

Install connect and serve-static
$ cd [webapp] $ npm install connect serve-static
编写server.js

1
2
3
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080)

运行:
$ node server.js &