configuration.ts
nest.js/03-advanced/code/config/configuration.ts
export default () => ({
app: {
name: process.env.APP_NAME || 'NestJS Advanced',
port: parseInt(process.env.PORT, 10) || 3000,
env: process.env.NODE_ENV || 'development',
},
database: {
host: process.env.DATABASE_HOST || 'localhost',
port: parseInt(process.env.DATABASE_PORT, 10) || 5432,
name: process.env.DATABASE_NAME || 'nestjs_db',
},
cache: {
host: process.env.CACHE_HOST || 'localhost',
port: parseInt(process.env.CACHE_PORT, 10) || 6379,
ttl: parseInt(process.env.CACHE_TTL, 10) || 300,
},
});
Articoli correlati
app.controller.ts
app.controller.ts — typescript source code from the nest.js learning materials (nest.js/01-beginner/code/app.controller.ts).
Leggi l'articolo →app.module.ts
app.module.ts — typescript source code from the nest.js learning materials (nest.js/01-beginner/code/app.module.ts).
Leggi l'articolo →app.service.ts
app.service.ts — typescript source code from the nest.js learning materials (nest.js/01-beginner/code/app.service.ts).
Leggi l'articolo →main.ts
main.ts — typescript source code from the nest.js learning materials (nest.js/01-beginner/code/main.ts).
Leggi l'articolo →todos.controller.ts
todos.controller.ts — typescript source code from the nest.js learning materials (nest.js/01-beginner/code/todos/todos.controller.ts).
Leggi l'articolo →todos.module.ts
todos.module.ts — typescript source code from the nest.js learning materials (nest.js/01-beginner/code/todos/todos.module.ts).
Leggi l'articolo →