Spaces:
Sleeping
Sleeping
Create server.js
Browse files
server.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import express from 'express';
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
const app = express();
|
| 5 |
+
app.use(express.json());
|
| 6 |
+
|
| 7 |
+
//Routes
|
| 8 |
+
|
| 9 |
+
app.get('/', (req, res) => {
|
| 10 |
+
res.json({ status: 'ok' });
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
+
app.post('/route', (req, res) => {
|
| 14 |
+
const { name, value } = req.body;
|
| 15 |
+
res.json({ success: true });
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
// Start
|
| 19 |
+
|
| 20 |
+
app.listen(7860, () => console.log('server running on port 7860'));
|