diff --git a/README.md b/README.md index 96d5f35c..1724f7b8 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Then edit `package.json` like this; { "main": "dist/src/main.js", "scripts": { - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "start": "tsc && func start" } } diff --git a/examples/azure-functions-minimal/package.json b/examples/azure-functions-minimal/package.json index 09560fd4..c61ef0ce 100644 --- a/examples/azure-functions-minimal/package.json +++ b/examples/azure-functions-minimal/package.json @@ -7,7 +7,7 @@ "build": "tsc", "lint": "tsc --noEmit", "start": "tsc && func start", - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts" }, "author": "Thada Wangthammang", "license": "MIT", diff --git a/examples/azure-functions-timer-trigger/package.json b/examples/azure-functions-timer-trigger/package.json index 08aa8b9d..873fa030 100644 --- a/examples/azure-functions-timer-trigger/package.json +++ b/examples/azure-functions-timer-trigger/package.json @@ -7,7 +7,7 @@ "build": "tsc", "lint": "tsc --noEmit", "start": "tsc && func start", - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts" }, "author": "Thada Wangthammang", "license": "MIT", diff --git a/examples/azure-functions-with-inversify/package.json b/examples/azure-functions-with-inversify/package.json index 40513e8d..b0028722 100644 --- a/examples/azure-functions-with-inversify/package.json +++ b/examples/azure-functions-with-inversify/package.json @@ -7,7 +7,7 @@ "build": "tsc", "lint": "tsc --noEmit", "start": "tsc && func start", - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts" }, "author": "Thada Wangthammang", "license": "MIT", diff --git a/examples/azure-functions-with-test/package.json b/examples/azure-functions-with-test/package.json index 6d840fb7..5a3f155e 100644 --- a/examples/azure-functions-with-test/package.json +++ b/examples/azure-functions-with-test/package.json @@ -7,7 +7,7 @@ "build": "tsc", "lint": "tsc --noEmit", "start": "tsc && func start", - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts" }, "author": "Thada Wangthammang", "license": "MIT", diff --git a/examples/azure-functions-with-trpc/package.json b/examples/azure-functions-with-trpc/package.json index 7df9cf33..728ad809 100644 --- a/examples/azure-functions-with-trpc/package.json +++ b/examples/azure-functions-with-trpc/package.json @@ -8,7 +8,7 @@ "lint": "tsc --noEmit", "start": "tsc && func start", "start:client": "tsx src/client.ts", - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "dev:old": "nodemon --watch src --ext ts --exec 'npm run build'" }, "author": "Thada Wangthammang", diff --git a/examples/azure-functions/package.json b/examples/azure-functions/package.json index d96c0616..3a265e1b 100644 --- a/examples/azure-functions/package.json +++ b/examples/azure-functions/package.json @@ -7,7 +7,7 @@ "build": "tsc", "lint": "tsc --noEmit", "start": "tsc && func start", - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts" + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts" }, "author": "Thada Wangthammang", "license": "MIT", diff --git a/packages/azure-functions/README.md b/packages/azure-functions/README.md index 96d5f35c..1724f7b8 100644 --- a/packages/azure-functions/README.md +++ b/packages/azure-functions/README.md @@ -75,7 +75,7 @@ Then edit `package.json` like this; { "main": "dist/src/main.js", "scripts": { - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "start": "tsc && func start" } } diff --git a/packages/azure-functions/src/handler-resolver.ts b/packages/azure-functions/src/handler-resolver.ts index c7e88f1a..c62bad12 100644 --- a/packages/azure-functions/src/handler-resolver.ts +++ b/packages/azure-functions/src/handler-resolver.ts @@ -149,7 +149,7 @@ export class AzureFunctionsHandlerResolver extends BaseHandlerResolver { logger.debug(`Running with runtime: ${app.runtime}`); logger.debug(`runtime: ${app.runtime}, isDevelopment: ${app.isDevelopment}`); - if (app.runtime === 'express' && process.env.NAMMATHAM_ENV !== 'development') { + if (app.runtime === 'express' && process.env.NODE_ENV !== 'development') { throw new Error( `expressPlugin will not start express server in production mode for Azure Functions Adapter, because Azure Functions will start the server for us. Please make set isDevelopment to be 'false' when use expressPlugin in production mode.` diff --git a/packages/core/README.md b/packages/core/README.md index 96d5f35c..1724f7b8 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -75,7 +75,7 @@ Then edit `package.json` like this; { "main": "dist/src/main.js", "scripts": { - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "start": "tsc && func start" } } diff --git a/packages/core/src/logger.ts b/packages/core/src/logger.ts index f1ece34a..8d04b539 100644 --- a/packages/core/src/logger.ts +++ b/packages/core/src/logger.ts @@ -1,5 +1,5 @@ import pino from 'pino'; -const isDevelopment = process.env.NAMMATHAM_ENV === 'development'; +const isDevelopment = process.env.NODE_ENV === 'development'; export const _logger = pino({ level: process.env.NAMMATHAM_LOG_LEVEL || 'info', diff --git a/packages/express/README.md b/packages/express/README.md index 96d5f35c..1724f7b8 100644 --- a/packages/express/README.md +++ b/packages/express/README.md @@ -75,7 +75,7 @@ Then edit `package.json` like this; { "main": "dist/src/main.js", "scripts": { - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "start": "tsc && func start" } } diff --git a/packages/express/src/express-server.ts b/packages/express/src/express-server.ts index 2b1efb71..ba9c7d29 100644 --- a/packages/express/src/express-server.ts +++ b/packages/express/src/express-server.ts @@ -21,7 +21,7 @@ export interface ExpressServerOption { */ export function expressPlugin(option?: ExpressServerOption) { return (app: NammathamApp, handlerResolver: BaseHandlerResolver) => { - const isDevelopment = option?.isDevelopment ?? process.env.NAMMATHAM_ENV === 'development'; + const isDevelopment = option?.isDevelopment ?? process.env.NODE_ENV === 'development'; if (!isDevelopment) { logger.debug('Skipping express server'); return; diff --git a/packages/main/README.md b/packages/main/README.md index 96d5f35c..1724f7b8 100644 --- a/packages/main/README.md +++ b/packages/main/README.md @@ -75,7 +75,7 @@ Then edit `package.json` like this; { "main": "dist/src/main.js", "scripts": { - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "start": "tsc && func start" } } diff --git a/packages/trpc-azure-functions/README.md b/packages/trpc-azure-functions/README.md index 96d5f35c..1724f7b8 100644 --- a/packages/trpc-azure-functions/README.md +++ b/packages/trpc-azure-functions/README.md @@ -75,7 +75,7 @@ Then edit `package.json` like this; { "main": "dist/src/main.js", "scripts": { - "dev": "cross-env NAMMATHAM_ENV=development tsx watch src/main.ts", + "dev": "cross-env NODE_ENV=development tsx watch src/main.ts", "start": "tsc && func start" } } diff --git a/packages/trpc-azure-functions/src/trpc-azure-functions.ts b/packages/trpc-azure-functions/src/trpc-azure-functions.ts index c955d61e..b420700a 100644 --- a/packages/trpc-azure-functions/src/trpc-azure-functions.ts +++ b/packages/trpc-azure-functions/src/trpc-azure-functions.ts @@ -45,7 +45,7 @@ export function unstable__tRpcAzureFunctionsPlugin( }); app.addFunction(trpcFunction); - const isDevelopment = option?.expressPluginOption?.isDevelopment ?? process.env.NAMMATHAM_ENV === 'development'; + const isDevelopment = option?.expressPluginOption?.isDevelopment ?? process.env.NODE_ENV === 'development'; if (!isDevelopment) { logger.debug('Skipping express server in development mode (trpc)'); return;