Local debugging
You can start the service locally and access the online service for debugging.
To complete this tutorial, you need to complete the following steps:
- A project initialized with
giteeteam-apps init
, tutorial link - Install and run docker
1. Log in to the specified domain name
Use the login command(please refer to: Login. Log in to the specified domain name server.
giteeteam-apps login
2. Build app
Build app and the output is *.zip
yarn build-app
The build-app
command is already defined in package.json
.
3. Publish application (development environment)
Deploy the application package built in the previous step.(please refer to: Deploy)
giteeteam-apps deploy xxx.zip
The default is the development environment application, and the application published from the application market page is the production environment application.
4. Subscribe to the application
Go to the developer center page http://{domain}/apps/page/application/developer
domain is the domain name you logged in to.
The subscription method is the same as the Deploy in the application market.
5. Run the front-end project locally
Run the command to start the local project:
yarn dev
The dev
command is already defined in package.json
.
6. Debugging with tunnels
6.1 Use the tunnel command(please refer to:Tunnel)to enable local debugging。
giteeteam-apps tunnel
6.2 After enabling the tunnel, you also need to add APPS_ENABLE_LOCAL_DEV=true
to LocalStorage of your local browser,
6.3 Then you can directly debug local front-end code on the online service:
6.4 Accessing the online webtrigger can also debug the local function code:
POST http://{origin}/apps/api/v1/:tenant/apps/workspace_page_demo/environments/development/webtriggers/:webtriggerKey
production vs staging vs development
There are three environments for applications, and local debugging uses the development environment.
The similarities and differences between the environments are as follows:
- For the same trigger of an application in different environments, the triggers of production, staging, and development applications will all be executed separately.
- However, the trigger of a production application can be either asynchronous or synchronous blocking, while the triggers of staging and development applications must be asynchronous.
7. App Runtime Environment
- Production: The production environment, where the app's trigger can be asynchronous or synchronous blocking.
- Staging: The pre-release environment, where the app's trigger must be asynchronous.
- Development: The development environment, where the app's trigger must be asynchronous.
The development environment is used for local debugging.