Merge branch 'master' of https://git.zakscode.com/ztimson/Apollo
This commit is contained in:
commit
a127bcfbbd
1152
package-lock.json
generated
Normal file
1152
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,11 +5,12 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node src/main.js"
|
"apollo": "node src/main.js"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"cors": "^2.8.5",
|
||||||
"@ztimson/utils": "^0.21.6",
|
"@ztimson/utils": "^0.21.6",
|
||||||
"express": "^4.21.1",
|
"express": "^4.21.1",
|
||||||
"i2c-bus": "^5.2.3",
|
"i2c-bus": "^5.2.3",
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import cors from 'cors';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import APOLLO from './apollo.js';
|
import APOLLO from './apollo.js';
|
||||||
@ -13,7 +14,9 @@ export default class Daemon {
|
|||||||
|
|
||||||
this.express = express();
|
this.express = express();
|
||||||
|
|
||||||
this.express.get('/api/*', async (req, res) => {
|
this.express.use(cors('*'));
|
||||||
|
|
||||||
|
this.express.get('/api/*', async (req, res) => {
|
||||||
const cmd = req.params['0'];
|
const cmd = req.params['0'];
|
||||||
res.json(await this.run(cmd));
|
res.json(await this.run(cmd));
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {adjustedInterval, sleep} from './misc.js';
|
import {adjustedInterval, sleep} from '@ztimson/utils';
|
||||||
import {bms} from './bms.js';
|
import {bms} from './bms.js';
|
||||||
import {bme} from './bme280.js';
|
import {bme} from './bme280.js';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user