When the directory structure of your Node.js application has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');Those suck for maintenance and they're ugly.
| enyo.kind({ | |
| name: "LeafletMap", | |
| classes: "leaflet-map", | |
| published: { | |
| center: { lat: 33.7489, lng: -84.3881}, | |
| showMarker: true, | |
| zoom: 17, | |
| // point imagePath to your leaflet images folder | |
| imagePath: "lib/extra/leaflet/images/", | |
| cloudmadeApiKey: "", |
| /** | |
| * Monitor contstructor. | |
| * | |
| * @param {Object} io the SocketIO object | |
| * @param {Object} bio BidIO object | |
| * @param {Object} options monitor options | |
| * @api public | |
| */ | |
| function Monitor (io, bio, options) { |
| <!Doctype html> | |
| <html lang="en"> | |
| <head> | |
| </head> | |
| <body> | |
| <h1>Socket Test</h2> | |
| <script src="http://localhost/socket.io/socket.io.js"></script> |
| <!Doctype html> | |
| <html> | |
| <head> | |
| <script src="/primus/primus.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| var primus = new Primus('ws://localhost:5000', { transformer: 'engine.io' }); |
| 'use strict'; | |
| /** | |
| * Module dependencies. | |
| */ | |
| var PilotAdapter('./custom-adapter') | |
| , pilotsAdapter = new PilotsAdapter(); | |
| // primus-rooms call the set method |
| # References: | |
| # http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/ | |
| # http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/ | |
| # | |
| global | |
| nbproc 2 | |
| maxconn 16384 | |
| defaults |
When the directory structure of your Node.js application has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');Those suck for maintenance and they're ugly.
| <!DOCTYPE> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <a id="eushell">EUSHELL</a> | |
| <a id="cayasso">CAYASSO</a> |
| <!doctype> | |
| <html> | |
| <head> | |
| <title>Chat</title> | |
| </head> | |
| <body> | |
| <form id="formDatos"> | |
| <input type="text" id="dato" placeholder="Escriba el texto" required> | |
| <input type="submit" value="enviar"> | |
| </form> |