javascript - Node not sending scripts -
javascript - Node not sending scripts -
i'm trying tutorial: http://angular.github.io/angular-phonecat/step-11/app/#/phones. when place these files mamp, works. however, when seek making node server, doesn't send js files. checked using inspectelement. sends index.html. why happening?
//server.js var express = require('express'); var app = express(); var port = process.env.port || 8887; app.configure(function() { app.use(express.static(__dirname + './public')); app.use(express.logger('dev')); app.use(express.bodyparser()); }); require('./app/router')(app); app.listen(port); console.log('listening port 8887'); exports = module.exports = app; //./app/router.js module.exports = function(app){ app.get('/', function(req, res){ res.sendfile('./public/index.html'); });
change ./public
/public/
, create sure scripts in public folder.
javascript node.js angularjs web mean-stack
Comments
Post a Comment