-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·27 lines (20 loc) · 916 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const express = require('express');
const http = require('http');
const os = require('os');
const path = require('path');
const controller = require('./controller'); //controller.js
const cronData = require('./cronData'); //cronData.js permets d'écrire la base de donnée en arrière plan
const camera = require('raspberry-pi-mjpeg-server/raspberry-pi-mjpeg-server'); //port 8085
const app = express();
//routes
app.get ('/', controller.Index);
app.get ('/arrosage/:time', controller.Arrosage);
app.get ('/arrosagePuits', controller.ArrosagePuits);
app.get ('/database', controller.MakeData);
app.get ('/niveauCuve', controller.niveauCuve);
app.listen(8080);
console.log("Le site du jardin est disponible sur le port 8080");
//configure app
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
app.use('/public', express.static(__dirname + '/public'));