Set env to node_env for the server
This commit is contained in:
		
							
								
								
									
										15
									
								
								src/app.ts
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/app.ts
									
									
									
									
									
								
							@@ -8,15 +8,16 @@ dotenvSafe.config();
 | 
			
		||||
const PORT = process.env.APP_PORT || 4010;
 | 
			
		||||
 | 
			
		||||
const app = createExpressServer({
 | 
			
		||||
    controllers: [__dirname + "/controllers/*.ts"],
 | 
			
		||||
  controllers: [__dirname + "/controllers/*.ts"],
 | 
			
		||||
  development: process.env.NODE_ENV === "production",
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
async function main() {
 | 
			
		||||
    await loaders(app);
 | 
			
		||||
    app.listen(PORT, () => {
 | 
			
		||||
        consola.success(
 | 
			
		||||
            `⚡️[server]: Server is running at http://localhost:${PORT}`
 | 
			
		||||
        );
 | 
			
		||||
    });
 | 
			
		||||
  await loaders(app);
 | 
			
		||||
  app.listen(PORT, () => {
 | 
			
		||||
    consola.success(
 | 
			
		||||
      `⚡️[server]: Server is running at http://localhost:${PORT}`
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
main();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user