@rpcbase/api 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/initApi.ts +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/api",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "scripts": {
package/src/initApi.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import assert from "assert"
2
-
2
+ import dotenv from "dotenv"
3
3
  import BBPromise from "bluebird"
4
4
  import { Application , json } from "express"
5
5
 
@@ -8,6 +8,13 @@ import { initApiClient } from "@rpcbase/client"
8
8
  import { Api, ApiHandler, Payload, Result, Middleware } from "./types"
9
9
 
10
10
 
11
+ // dotenv setup, merge process env with vite process.env file
12
+ process.env = {
13
+ ...process.env,
14
+ ...dotenv.config().parsed
15
+ }
16
+
17
+
11
18
  type RouteModule = [string, () => Promise<{default: (api: Api) => void}>]
12
19
 
13
20
  export const initApi = async (app: Application) => {