I would like to see which routes are added by a module using node.js. For instance using Socket.io, I require /socket.io/socket.io.js, yet I do not see this in my public directory or the directory of socket.io:
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
The resource loads a file when I inspect the url:
http://localhost:3111/socket.io/socket.io.js
How can I use the rails equivalent of "rake routes"?
The URL your browser requests does not have to map to a physical file on your filesystem. Socket.IO, for instance, adds scripts to your server's routes via the lib/static.js
file ; check out the code and you'll see routes for JavaScripts, SWF resources, and more.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.