mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 01:10:42 +08:00
Add ng serve local proxy configuration for api calls
This commit is contained in:
parent
6cc736f623
commit
d4baf71483
4 changed files with 20 additions and 4 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -11,6 +11,10 @@
|
||||||
/vendor/
|
/vendor/
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
|
###> ng serve ###
|
||||||
|
/proxy.conf.local.json
|
||||||
|
###< ng serve ###
|
||||||
|
|
||||||
build/
|
build/
|
||||||
config/
|
config/
|
||||||
!config/.gitkeep
|
!config/.gitkeep
|
||||||
|
|
10
README.md
10
README.md
|
@ -44,6 +44,10 @@ find . -type d -exec chmod 0755 {} \;
|
||||||
find . -type f -exec chmod 0644 {} \;
|
find . -type f -exec chmod 0644 {} \;
|
||||||
chmod +x bin/console
|
chmod +x bin/console
|
||||||
```
|
```
|
||||||
5. Run `bin/console orm:schema-tool:update --force`
|
5. Go back to root folder
|
||||||
6. Run `npm install`
|
6. Run `bin/console orm:schema-tool:update --force`
|
||||||
7. Run `ng build`
|
7. Run `npm install`
|
||||||
|
8. Setup proxy config for `ng serve`
|
||||||
|
- Copy `proxy.conf.env.json` to `proxy.conf.local.json`
|
||||||
|
- Replace `"target": "http//<api_host>:<api_port>"` with your api url
|
||||||
|
9. Run `ng build` or `ng serve`
|
|
@ -60,7 +60,8 @@
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "SuiteCRM:build:serve"
|
"browserTarget": "SuiteCRM:build:serve",
|
||||||
|
"proxyConfig": "./proxy.conf.local.json"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
|
|
7
proxy.conf.env.json
Normal file
7
proxy.conf.env.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"/api/*": {
|
||||||
|
"target": "http//<api_host>:<api_port>",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue