gp-front-dev-server
v0.4.14
Published
Vite dev server for gp-front with proxy and local pages support
Downloads
542
Readme
gp-front-dev-server
Development server for gp-front.
Why?
Development process is complicated. To develop new platform features and components we need to have an ability to run development process locally. We need a dev server for this. First of all our server should work as regular proxy. On one hand, it should have an ability to proxy requests, addressed to database (analitical server) and backend:
- data requests to
/api
- storage requests
- session requests
and on the other, it should communicate with
/graphql
endpoint to read, create, update and delete the assets.
The pages are composed of assets. Pages are the crucial parts of the application that need to be treated with extra care as they are not currently protected by git (but the situation is expected to change soon).
They located on the server side, in file system. Sometimes (very often!) we need more freedom in editing them.
And of course we want to see all the changes in out sources hot-reloaded.
This server was created to solve these problems.
Installation
npm i -D gp-front-dev-server
Environment variables configuration
Use this .env.example and edit it with your credentials for development.
Usage in gp-front
Add to package.json
scripts section:
"dev": "gp-front-dev-server"
and run npm run dev
.
How to use gp-front-dev-server for local pages development?
Add to .env in your gp-front repo the variables:
USE_INSTANCE_PAGES_DIR_LOCAL=1
INSTANCE_PAGES_DIR_LOCAL=<path-to-local-pages-dir>
You can avoid loading remote page server-side rendered information with env var:
USE_LOCAL_PAGES_HTML=1