Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require("appdynamics").profile({
controllerHostName: '<CONTROLLER URI>',
controllerPort: 443,
controllerSslEnabled: true,
accountName: '<ACCOUNT>',
accountAccessKey: '<KEY>',
applicationName: '<APP NAME>',
tierName: '<TIER NAME>',
nodeName: '<NODE NAME>'
});
var express = require('express');
var cors = require('cors');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.get('/hello', function(req, res) {
console.log(new Date(), 'In hello route GET / req.query=', req.query);
var world = req.query && req.query.hello ? req.query.hello : 'World';
res.json({ msg: 'Hello ' + world });
});
app.post('/hello', function(req, res) {
console.log(new Date(), 'In hello route POST / req.body=', req.body);
var world = req.body && req.body.hello ? req.body.hello : 'World';
res.json({ msg: 'Hello ' + world });
});
var port = process.env.FH_PORT || process.env.OPENSHIFT_NODEJS_PORT || 8001;
var host = process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0';
app.listen(port, host, function() {
console.log("App started at: " + new Date() + " on port: " + port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment