diff --git a/README.md b/README.md index 20a7fd6..b48c037 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ npm install license-lib Environment Setup -Create a .env file at the root with your database and JWT configuration: +Create a .env file at the root with your database, backend url and JWT configuration: -env -```JWT_SECRET=your_jwt_secret +```env +JWT_SECRET=your_jwt_secret DB_HOST=localhost DB_NAME=license_db DB_USER_ADMIN=license_admin @@ -26,6 +26,7 @@ DB_PASS_ADMIN=secure_admin_password DB_USER_READER=license_reader DB_PASS_READER=secure_reader_password JWT_SECRET=your_jwt_secret +VITE_LICENSE_API_URL=https://your.backend.url.com/api #or http://localhost:3000 ``` diff --git a/client/config.js b/client/config.js index bdba282..ebe65d8 100644 --- a/client/config.js +++ b/client/config.js @@ -1,7 +1,7 @@ // client/config.js export const CONFIG = { - LICENSE_API_URL: 'http://localhost:3000', // backend API URL + LICENSE_API_URL: import.meta.env.VITE_LICENSE_API_URL || 'http://localhost:3000', OFFLINE_GRACE_PERIOD_DAYS: 14, }; \ No newline at end of file diff --git a/example.env b/example.env index 840e3da..b808d82 100644 --- a/example.env +++ b/example.env @@ -7,3 +7,4 @@ DB_PASS_ADMIN=secure_admin_password DB_USER_READER=license_reader DB_PASS_READER=secure_read_password JWT_SECRET=your_jwt_secret +VITE_LICENSE_API_URL=https://your.backend.url.com/api #or http://localhost:3000 diff --git a/package.json b/package.json index 2cacd58..83ed915 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "license-lib", - "version": "1.0.2", + "version": "1.0.3", "description": "Simple, secure licensing library for Node.js, React, and Next.js.", "main": "server/index.js", "author": "Joseph Thompson ",