【发布时间】:2015-03-13 00:19:31
【问题描述】:
我正在尝试将 ExpressJS 与由 AngularJS Yeoman 生成器安装的 Angular 的脚手架版本一起使用。我更喜欢使用 Yeoman 团队创建的脚手架版本,而不是使用 angular-fullstack 或 express 版本。所以我在我的项目的服务器文件夹中手动安装了 Express JS。
-app //Angular files are here
-server //Node JS files are here
我认为当前使用的是连接服务器而不是 Express。有没有办法将 grunt 文件改为 require Express?
我认为这是我的 gruntfile.js 中的相关代码:
// The actual grunt server settings
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
livereload: {
options: {
open: true,
middleware: function (connect) {
return [
connect.static('.tmp'),
connect().use(
'/bower_components',
connect.static('./bower_components')
),
connect().use(
'/app/styles',
connect.static('./app/styles')
),
connect.static(appConfig.app)
];
}
}
}
【问题讨论】:
标签: angularjs node.js express gruntjs yeoman