reogranized app and added more headers
This commit is contained in:
parent
1048ab5c20
commit
223f426a58
10 changed files with 925 additions and 218 deletions
35
src/config.ts
Normal file
35
src/config.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* Configuration and environment variables
|
||||
*/
|
||||
|
||||
export const config = {
|
||||
api: {
|
||||
key: process.env.API_KEY,
|
||||
port: parseInt(process.env.PORT || '2424'),
|
||||
host: process.env.HOST || '0.0.0.0',
|
||||
version: '1.0.0'
|
||||
},
|
||||
|
||||
environment: {
|
||||
nodeEnv: process.env.NODE_ENV || 'production',
|
||||
isDevelopment: process.env.NODE_ENV === 'development'
|
||||
},
|
||||
|
||||
server: {
|
||||
// Trust proxy settings for Kubernetes and common networks
|
||||
trustProxy: [
|
||||
'10.0.0.0/8', // Private networks
|
||||
'172.16.0.0/12', // Docker/K8s networks
|
||||
'192.168.0.0/16', // Local networks
|
||||
'127.0.0.1', // Localhost
|
||||
'::1' // IPv6 localhost
|
||||
],
|
||||
|
||||
cors: {
|
||||
origin: true,
|
||||
methods: ['GET', 'POST', 'OPTIONS']
|
||||
},
|
||||
|
||||
maxCachedResults: 1000
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue