Versions Compared

Key

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

Exposes the Express server app object, allowing you to call various Express API to customize the web server. This is typically used in the start.js file to setup custom route maps, authentication, 

Example

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


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


// Setup a custom alias under the web server that outputs some content
app.get('/mycustomalias', function(req, res) {
  res.send('My Custom Content');
});
 
// Start Profound.js server
profoundjs.server.listen();
console.log('Profound.js server running at http://%s:%d/', config.host, config.port);