Skip to content

Commit

Permalink
0.1.19 ready for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamint08 committed Apr 12, 2024
1 parent ff5432b commit a5c6ea5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {query} from "../helpers/query.ts";
import {param} from "../helpers/param.ts";
import MongoService from "../instances/mongodb.ts";
import PgService from "../instances/postgres.ts";
import { version } from "../../package.json"
import { version } from "../../package.json";

let globalFolder = "";

const isNotProd = process.env.NODE_ENV !== 'production';
let log = false;
Expand Down Expand Up @@ -39,7 +41,7 @@ async function loadFolder(folder: string) {
const allRoutes = new Glob(`${folder}/*.ts`);
for await (let file of allRoutes.scan(".")) {
file = file.replace(/\\/g, '/');
let realfile = file.split('/').slice(1).join('/').replace(/.ts/g, '');
let realfile = file.replace(globalFolder + "/", '').replace(/.ts/g, '');
file = file.split('/')[file.split('/').length - 1];
const splits = file.split("/");
const filePath = path.join(process.cwd(), folder, file);
Expand Down Expand Up @@ -242,6 +244,7 @@ class ProBun {
if(this.pgConfig) {
await PgService.getInstance().connect(this.pgConfig);
}
globalFolder = this.routes;
startServer(this.port, this.routes, this.logger);
}

Expand Down

0 comments on commit a5c6ea5

Please sign in to comment.