animaplanos modulo 8 pdf download
animaplanos modulo 8 pdf download
animaplanos modulo 8 pdf download
.
Q:
Node.js / Express.js / Socket.IO / Jade - Links not working
I'm trying to make a web app that uses Node.js, Express.js, Jade, Socket.IO and HTML5. I'm pretty new to everything, so it may be something dumb, but I don't know what. I'm following this tutorial but it doesn't seem to work, as links are not working.
Edit: This is the exact tutorial that I'm following.
What I've Tried:
Cleaning the code, since it looked like the 'Hello World' example
Adding the jade and html extensions to the config.js file
Opening the socket.io.js file
Code
Server.js
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io').listen(server);
server.listen(3000);
app.use(express.static(__dirname + '/public'));
app.get('/', function(req, res) {
res.sendFile(__dirname + '/public/index.html');
});
var port = process.env.PORT || 3000;
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
});
app.get('/socket.io', function(req, res) {
res.sendfile('./public/socket.io.js');
});
app.get('/hello/:name', function(req, res) {
res.send("Hello! :name");
});
var fs = require('fs');
var template = fs.readFileSync(__dirname + '/public/index.jade', {encoding: 'utf8'});
io.sockets.on('connection', function (socket) {
socket.on('message', function(data) {
io.sockets.emit('message', data);
});
socket. ac619d1d87
Related links:
Comments