Created
June 7, 2017 07:32
-
-
Save fizerkhan/43761c53a5dc4888dd0abe48947bbe92 to your computer and use it in GitHub Desktop.
Atatus Node Agent with ES6
This file contains 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
import http from 'http'; | |
import express from 'express'; | |
import morgan from 'morgan'; | |
import bodyParser from 'body-parser'; | |
let app = express(); | |
app.server = http.createServer(app); | |
app.use(morgan('dev')); | |
app.use(bodyParser.json({})); | |
app.get('/', (req, res) => { | |
res.json({ version: '1.0.0' }); | |
}); | |
app.get('/health', (req, res) => { | |
res.json({ status: 'Good' }); | |
}); | |
app.server.listen(process.env.PORT || 9000, () => { | |
console.log(`Started on port ${app.server.address().port}`); | |
}); | |
export default app; |
This file contains 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
var atatus = require("atatus-node"); | |
atatus.start({ apiKey: 'your_api_key' }); | |
module.exports = require('./app.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can execute as