mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Added local dev env configuration
- call init by default if there's an env var for ADMIN_URL - add an example local dev config
This commit is contained in:
parent
e9a193445d
commit
c3d13f2451
2
ghost/portal/.env.local.example
Normal file
2
ghost/portal/.env.local.example
Normal file
@ -0,0 +1,2 @@
|
||||
REACT_APP_ADMIN_URL=http://localhost:2368/ghost
|
||||
REACT_APP_SITE_URL=http://localhost:2368
|
@ -1,7 +1,13 @@
|
||||
# Membersjs
|
||||
# Members.js
|
||||
|
||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
||||
|
||||
## Configure for local development
|
||||
|
||||
- Copy `.env.local.example` to `.env.local`
|
||||
- Update the values to match your local dev version of Ghost
|
||||
- Ensure your local Ghost is running
|
||||
|
||||
## Available Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
@ -12,9 +12,15 @@ function initMembersJS(data) {
|
||||
);
|
||||
}
|
||||
|
||||
// Uncomment for local UI testing
|
||||
// initMembersJS({site: {siteUrl: "", adminUrl: ""}});
|
||||
|
||||
window.GhostMembers = {
|
||||
initMembersJS: initMembersJS
|
||||
};
|
||||
|
||||
// This will automatically load for local if an .env.local file is present
|
||||
if (process.env.REACT_APP_ADMIN_URL) {
|
||||
let site = {
|
||||
adminUrl: process.env.REACT_APP_ADMIN_URL,
|
||||
siteUrl: process.env.REACT_APP_SITE_URL || process.env.REACT_APP_ADMIN_URL
|
||||
};
|
||||
initMembersJS({site});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user