Created
December 4, 2019 16:09
-
-
Save Unitech/fc94afbd62d00c3f505285dd103e5ea8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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