1
0
mirror of https://api.glitch.com/git/presence-button synced 2024-11-16 17:17:29 +00:00
presence-button-web-glitch/server.js
Glitch (hello-express) 4f3e815d30 🌔😺 Checkpoint
./server.js:334152/7
2018-06-29 19:22:21 +00:00

23 lines
652 B
JavaScript

// server.js
// where your node app starts
// init project
var express = require('express');
var app = express();
// we've started you off with Express,
// but feel free to use whatever libs or frameworks you'd like through `package.json`.
// http://expressjs.com/en/starter/static-files.html
app.use(express.static('public'));
// http://expressjs.com/en/starter/basic-routing.html
app.get('/', function(request, response) {
response.sendFile(__dirname + '/views/index.html');
});
// listen for requests :)
var listener = app.listen(process.env.PORT, function () {
console.log('Your app is listening on port ' + listener.address().port);
});