Snek/index.js

17 lines
331 B
JavaScript
Raw Normal View History

2020-03-23 19:11:39 +00:00
const express=require('express');
const app=express();
const PORT=process.env.PORT || 3000;
2020-04-13 19:58:53 +00:00
app.use(express.json());
2020-03-23 19:11:39 +00:00
app.use(express.static('public'));
2020-04-13 19:58:53 +00:00
app.use('/api', require('./api'));
app.get('/api/has-nodejs', (req, res) => {
res.json("yes");
});
2020-03-23 19:11:39 +00:00
app.listen(PORT, () => {
console.log(`Listening on 0.0.0.0:${PORT}`);
});