mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Fixed error in database api
This commit is contained in:
parent
c5650ba29a
commit
d681d3cee0
@ -5,7 +5,8 @@ module.exports = function (databasesLocation) {
|
||||
const path = require("path");
|
||||
|
||||
router.get('/:type/:name', function (req, res) {
|
||||
console.log(req.params.database)
|
||||
var contents = fs.readFileSync(path.join(databasesLocation, req.params.type, req.params.name + ".json"));
|
||||
res.status(200).send(contents);
|
||||
});
|
||||
|
||||
router.put('/save/:type/:name', function (req, res) {
|
||||
|
||||
@ -5,7 +5,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class AircraftDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super('databases/units/aircraftdatabase.json');
|
||||
super('databases/units/aircraftdatabase');
|
||||
}
|
||||
|
||||
getCategory() {
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class GroundUnitDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super('databases/units/groundunitdatabase.json');
|
||||
super('databases/units/groundunitdatabase');
|
||||
}
|
||||
|
||||
getSpawnPointsByName(name: string) {
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class HelicopterDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super('databases/units/helicopterdatabase.json');
|
||||
super('databases/units/helicopterdatabase');
|
||||
}
|
||||
|
||||
getSpawnPointsByName(name: string) {
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class NavyUnitDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super('databases/units/navyunitdatabase.json');
|
||||
super('databases/units/navyunitdatabase');
|
||||
}
|
||||
|
||||
getSpawnPointsByName(name: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user