1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-18 19:19:36 +02:00

Added WebSockets with funcionality to send messages from any module

This commit is contained in:
unknown 2021-05-19 17:17:24 +02:00
parent 4510a709d4
commit 38f5d3b66a
7 changed files with 84 additions and 21 deletions

21
api.js Normal file
View file

@ -0,0 +1,21 @@
const express = require('express');
const errorHandler = require('./middleware/errorHandler');
const api = express();
api.get('/', (req, res) => {
res.send('Server is working');
})
// Body parser
api.use(express.json());
// Link controllers with routes
api.use('/api/apps', require('./routes/apps'));
api.use('/api/config', require('./routes/config'));
api.use('/api/weather', require('./routes/weather'));
// Custom error handler
api.use(errorHandler);
module.exports = api;