mirror of
https://github.com/Spythere/srjp-td2.git
synced 2026-05-03 05:28:12 +00:00
29 lines
686 B
JavaScript
29 lines
686 B
JavaScript
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...');
|
|
});
|