Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
// Load Profound.js
var profoundjs = require("profoundjs");

// Apply configuration
var config = require("./config.js");
profoundjs.applyConfig(config);

// Start Profound.js server
var isWorker = profoundjs.server.listen();

if (isWorker) {
  // Setup a custom alias under the web server that outputs some content
  profoundjs.server.app.get('/mycustomalias', function(req, res) {
    res.send('My Custom Content');
  });

console.log('Profound.js server running at http://%s:%d/', config.host, config.port);
}