-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Вопрос по 11 части (nodejs-screencast-chat) #3
Comments
Видимо, нужно в исходнике поменять |
в login.ejs изменил <% layout('/layout/page') -%> на <% layout('C:\Chat\template\layout\page') -%>, спасибо, работает. |
Попробуй просто |
Да, так работает. |
User.find({ }, { username: 1, _id:0}, function(err, tester){
tester.forEach(function (user) {
console.log(user.username);
});
}); |
Спасибо за ваш отличный скринкаст! Помогите разобраться с 11 уроком.
"C:\Program Files\nodejs\node.exe" app.js
info: [C:\Chat\app.js] Express server listening on port 3000
GET / 200 36ms - 942b
GET /vendor/bower_components/bootstrap/dist/css/bootstrap.css 304 6ms
GET /css/app.css 304 6ms
GET /vendor/bower_components/jquery/jquery.js 304 6ms
GET /vendor/bower_components/bootstrap/dist/js/bootstrap.js 304 6ms
POST /logout 302 4ms - 58b
GET / 200 99ms - 825b
GET /vendor/bower_components/bootstrap/dist/css/bootstrap.css 304 3ms
GET /css/app.css 304 2ms
GET /vendor/bower_components/jquery/jquery.js 304 2ms
GET /vendor/bower_components/bootstrap/dist/js/bootstrap.js 304 2ms
GET /login 200 6ms - 2.48kb
GET /vendor/bower_components/bootstrap/dist/css/bootstrap.css 304 5ms
GET /css/app.css 304 5ms
GET /vendor/bower_components/jquery/jquery.js 304 4ms
GET /vendor/bower_components/bootstrap/dist/js/bootstrap.js 304 4ms
POST /login 200 5ms - 2b
GET /chat 304 4ms
GET /vendor/bower_components/bootstrap/dist/css/bootstrap.css 304 7ms
GET /css/app.css 304 9ms
GET /vendor/bower_components/jquery/jquery.js 304 8ms
GET /vendor/bower_components/bootstrap/dist/js/bootstrap.js 304 8ms
Останавливаю сервер пишет Process finished with exit code -1
Если в app.js закомментировать строку cb("123"); здесь:
io.sockets.on('connection', function (socket) {
socket.on('message', function (text, cb) {
socket.broadcast.emit('message', text);
//cb("123");
});
}); То сообщения отправляются, подскажите в чем проблема?
2) Если файлы из папки template не копировать в корень диска c:\ то на станице логина появляется такая ошибка:
Express
500 Error: ENOENT, no such file or directory 'C:\layout\page.ejs'
Хотя в папке проекта они есть (в С:\Chat\template). и NODE_PATH=C:\Chat и NODE_ENV=development
The text was updated successfully, but these errors were encountered: