mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 13:38:12 +00:00
chore: added api mocking
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import { cwd } from 'process';
|
||||
import cors from 'cors';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
|
||||
app.get('/api/getActiveData', (_, res) => {
|
||||
res.sendFile(path.join(cwd(), 'endpoints', 'getActiveData.json'));
|
||||
});
|
||||
|
||||
app.get('/api/getSceneries', (_, res) => {
|
||||
res.sendFile(path.join(cwd(), 'endpoints', 'getSceneries.json'));
|
||||
});
|
||||
|
||||
app.get('/api/getVehicles', (_, res) => {
|
||||
res.sendFile(path.join(cwd(), 'endpoints', 'getVehicles.json'));
|
||||
});
|
||||
|
||||
app.get('/api/getDonators', (_, res) => {
|
||||
res.sendFile(path.join(cwd(), 'endpoints', 'getDonators.json'));
|
||||
});
|
||||
|
||||
app.listen(3123, () => {
|
||||
console.log('Mocking API server...');
|
||||
});
|
||||
Reference in New Issue
Block a user