Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

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, etc.

The profoundjs.server.app object is not exposed until the profoundjs.server.listen()  API has been called.

Example

// 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');
  });

}
  • No labels