TSFastifyExample/config/environment.ts
2024-08-08 08:20:58 -04:00

43 lines
887 B
TypeScript

import { dirname, join } from "path";
import { fileURLToPath } from "url";
export interface IEnvironment {
development: boolean;
fastify: {
host: string;
port: number;
};
paths: {
src: string;
www: {
root: string;
views: string;
public: string;
}
};
}
const __dirname : string = join(dirname(fileURLToPath(import.meta.url)), "..");
const environment : IEnvironment = {
development: process.argv.includes("--development"),
fastify: {
host: "0.0.0.0",
port: 7788
},
paths: {
src: __dirname,
www: {
root: join(__dirname, "src", "www"),
views: join(__dirname, "src", "www", "views"),
public: join(__dirname, "src", "www", "public")
}
}
};
export default environment;
export { environment };