greenlock-express.js/examples/my-express-app.js

16 lines
381 B
JavaScript
Raw Permalink Normal View History

2018-07-03 09:25:12 +00:00
'use strict';
var express = require('express');
var app = express();
app.use('/', function (req, res) {
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.end('Hello, World!\n\n💚 🔒.js');
});
// DO NOT DO app.listen() unless we're testing this directly
if (require.main === module) { app.listen(3000); }
// Instead do export the app:
module.exports = app;