mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2026-01-25 14:14:06 +00:00
MASSIVE commit
- moved to typescript - axios rate limitmodule is busted, removed for now, do something else for that - sequelize-typescript - dotenv, not dotenv-flow - removed playlist details route types for API ton of minor fixes and improvements
This commit is contained in:
18
config/dotenv.ts
Normal file
18
config/dotenv.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// https://github.com/motdotla/dotenv/issues/133#issuecomment-255298822
|
||||
// explanation: ESM import statements execute first
|
||||
// so the .config gets called after all other imports in index.ts
|
||||
// and one of those imports is the sequelize loader, which depends on env being loaded
|
||||
// soln: raise the priority of dotenv to match by placing it in a separate module like this
|
||||
|
||||
import { config, type DotenvConfigOutput } from "dotenv";
|
||||
|
||||
const result: DotenvConfigOutput = config({
|
||||
path: [
|
||||
`.env.${process.env["NODE_ENV"]}.local`,
|
||||
`.env.${process.env["NODE_ENV"]}`,
|
||||
".env.local",
|
||||
".env",
|
||||
],
|
||||
});
|
||||
|
||||
export default result;
|
||||
Reference in New Issue
Block a user