Skip to content

Instantly share code, notes, and snippets.

@ShawonAshraf
Created May 12, 2020 22:25
Show Gist options
  • Select an option

  • Save ShawonAshraf/a6d9d2e9b563478b95d6c7ff7aed1a14 to your computer and use it in GitHub Desktop.

Select an option

Save ShawonAshraf/a6d9d2e9b563478b95d6c7ff7aed1a14 to your computer and use it in GitHub Desktop.
node-express-medium
import express from 'express';
import morgan from 'morgan';
import bodyParser from 'body-parser';
const app = express();
app.use(morgan('combined'));
app.use(bodyParser.json());
app.get('/', (req, res) => {
res.send({
message: 'hey there docker!',
status: '200',
});
});
app.get('/status', (req, res) => {
res.send({
status: '200',
});
});
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`Server running at * ${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment