Umstellung auf nodeclassic

This commit is contained in:
2024-09-04 14:56:24 +02:00
parent c5577969c8
commit d8429f9b4a
47 changed files with 330 additions and 508 deletions

View File

@@ -1,6 +1,6 @@
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
import { CountyRequest } from 'src/models/server.model.js';
import { GeoService } from './geo.service.js';
import { CountyRequest } from 'src/models/server.model';
import { GeoService } from './geo.service';
@Controller('geo')
export class GeoController {

View File

@@ -1,9 +1,9 @@
import { Module } from '@nestjs/common';
import { GeoController } from './geo.controller.js';
import { GeoService } from './geo.service.js';
import { GeoController } from './geo.controller';
import { GeoService } from './geo.service';
@Module({
controllers: [GeoController],
providers: [GeoService]
providers: [GeoService],
})
export class GeoModule {}

View File

@@ -1,12 +1,11 @@
import { Injectable } from '@nestjs/common';
import { readFileSync } from 'fs';
import path, { join } from 'path';
import { CityAndStateResult, CountyResult, GeoResult } from 'src/models/main.model.js';
import { fileURLToPath } from 'url';
import { City, CountyData, Geo, State } from '../models/server.model.js';
import { join } from 'path';
import { CityAndStateResult, CountyResult, GeoResult } from 'src/models/main.model';
import { City, CountyData, Geo, State } from '../models/server.model';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// const __filename = fileURLToPath(import.meta.url);
// const __dirname = path.dirname(__filename);
@Injectable()
export class GeoService {
@@ -24,7 +23,7 @@ export class GeoService {
this.counties = JSON.parse(rawCountiesData);
}
findCountiesStartingWith(prefix: string, states?: string[]) {
let results: CountyResult[] = [];
const results: CountyResult[] = [];
let idCounter = 1;
this.counties.forEach(stateData => {