Skip to content

Commit

Permalink
rename NAMMATHAM_ENV to NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed Jan 21, 2024
1 parent 6fd71f6 commit ba19fa2
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/azure-functions-minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/azure-functions-timer-trigger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/azure-functions-with-inversify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/azure-functions-with-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/azure-functions-with-trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/azure-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/azure-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/azure-functions/src/handler-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/logger.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/express/src/express-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/trpc-azure-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/trpc-azure-functions/src/trpc-azure-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function unstable__tRpcAzureFunctionsPlugin<TRouter extends AnyRouter>(
});
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;
Expand Down

0 comments on commit ba19fa2

Please sign in to comment.