2020-01-24 23:59:16 +01:00
|
|
|
|
---
|
|
|
|
|
title: Developing the Harbor Frontend
|
|
|
|
|
---
|
2019-10-17 15:47:25 +02:00
|
|
|
|
|
|
|
|
|
If you already have a harbor backend environment, you can build a frontend development environment with the following configuration.
|
|
|
|
|
|
|
|
|
|
1. Create the file proxy.config.json in the directory harbor/src/portal,and config it according to the sample below.
|
|
|
|
|
|
2020-01-24 23:59:16 +01:00
|
|
|
|
**NOTE:** You should replace “$IP_ADDRESS” with your own ip address.
|
2019-10-17 15:47:25 +02:00
|
|
|
|
|
2020-01-24 23:59:16 +01:00
|
|
|
|
```json
|
2019-10-17 15:47:25 +02:00
|
|
|
|
{
|
|
|
|
|
"/api/*": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"changeOrigin": true,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/service/*": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/c/login": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/sign_in": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/c/log_out": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/sendEmail": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/language": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/reset": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/userExists": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/reset_password": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/i18n/lang/*.json": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug",
|
|
|
|
|
"pathRewrite": { "^/src$": "" }
|
|
|
|
|
},
|
|
|
|
|
"/chartrepo": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
},
|
|
|
|
|
"/*.json": {
|
|
|
|
|
"target": "$IP_ADDRESS",
|
|
|
|
|
"secure": false,
|
|
|
|
|
"logLevel": "debug"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. Open the terminal and run the following command,install npm packages as 3rd-party dependencies.
|
2020-01-24 23:59:16 +01:00
|
|
|
|
|
|
|
|
|
```sh
|
2019-10-17 15:47:25 +02:00
|
|
|
|
cd harbor/src/portal
|
|
|
|
|
npm install
|
|
|
|
|
```
|
|
|
|
|
|
2019-12-17 12:42:52 +01:00
|
|
|
|
3. Execute the following command,serve Harbor locally.
|
2019-10-17 15:47:25 +02:00
|
|
|
|
|
2020-01-24 23:59:16 +01:00
|
|
|
|
```sh
|
2019-10-17 15:47:25 +02:00
|
|
|
|
npm run start
|
|
|
|
|
```
|
|
|
|
|
|
2020-01-24 23:59:16 +01:00
|
|
|
|
4. Then you can visit the Harbor by address: https://localhost:4200.
|