Compare commits
2 Commits
4b70f8d67b
...
00f11f8c08
Author | SHA1 | Date | |
---|---|---|---|
00f11f8c08 | |||
3e06856c70 |
1145
package-lock.json
generated
Normal file
1145
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
"@ztimson/utils": "^0.21.6",
|
||||
"express": "^4.21.1",
|
||||
"i2c-bus": "^5.2.3",
|
||||
|
@ -1,3 +1,4 @@
|
||||
import cors from 'cors';
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import APOLLO from './apollo.js';
|
||||
@ -13,7 +14,9 @@ export default class Daemon {
|
||||
|
||||
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'];
|
||||
res.json(await this.run(cmd));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user