Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created December 4, 2019 16:09
Show Gist options
  • Save Unitech/fc94afbd62d00c3f505285dd103e5ea8 to your computer and use it in GitHub Desktop.
Save Unitech/fc94afbd62d00c3f505285dd103e5ea8 to your computer and use it in GitHub Desktop.
const io = require('@pm2/io').init({
standalone: true, // mandatory
apmOptions: {
publicKey: 'xxx', // define the public key given in the dashboard
secretKey: 'yyyy', // define the private key given in the dashboard
appName: 'V10'
},
tracing: true
})
var express = require('express');
var app = express()
app.get('/', function(req, res) {
res.setHeader('Content-Type', 'text/plain')
setTimeout(() => {
res.send('Vous êtes à l\'accueil, que puis-je pour vous ?')
}, 350)
})
app.get('/sous-sol', function(req, res) {
res.setHeader('Content-Type', 'text/plain')
res.send('Vous êtes dans la cave à vins, ces bouteilles sont à moi !')
})
app.get('/etage/1/chambre', function(req, res) {
res.setHeader('Content-Type', 'text/plain')
res.send('Hé ho, c\'est privé ici !')
})
app.listen(8080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment