-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommonDescriptor.txt
94 lines (62 loc) · 2.66 KB
/
CommonDescriptor.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# AMBIENTE
Angular 17
Node.js 18
# COMANDOS DEV (common)
Install Node.js.
# Install the latest version of Angular (Global)
npm install -g @angular/cli
# COMANDOS DEV (frontend-area)
# (A) Criar Projeto
ng new frontend-area
# (B) Incluir dependencias em projeto descompactado (.zip)
"In your project directory, navigate to the first-app directory.
Run this command to install the dependencies needed to run the app."
npm install
# Builds the application, Starts the development server, Watches the source files, Rebuilds the application as you make changes.
cd frontend-area
ng serve --open # The --open flag opens a browser to http://localhost:4200
# Create Component Home
ng generate component home
# Create Component Entity Area
ng generate component entityArea
# Create Component List Entity Area
ng generate component listEntityArea
# Create Component Modal Actions Response
ng generate component modalActionsResponse
# Create a new service for your app
ng generate service area --skip-tests
# Avoid CORS
"To divert all calls for http://localhost:4200/area/api to a server running on http://localhost:8080/area/api, take the following steps."
# Create a file proxy.conf.json in your project's src/ folder.
# Add the following content to the new proxy file:
{
"/area/api": {
"target": "http://localhost:8080",
"secure": false
}
}
# (A) In the CLI configuration file, angular.json, add the proxyConfig option to the serve target:
architect -> serve -> configurations -> development -> + "proxyConfig": "src/proxy.conf.json"
# (B) Start the development server with option --proxy-config
ng serve --proxy-config=src/proxy.conf.json
"If you get an ECONNREFUSED error using a proxy targeting a localhost URL,
you can fix this issue by updating the target from http://localhost:<port> to http://127.0.0.1:<port>."
# HTTP: Setup for server communication
"Before you can use HttpClient, you must add it to the application's root dependency injector.
Most apps do so in the providers array of ApplicationConfig in app.config.ts."
import { ApplicationConfig } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { importProvidersFrom } from '@angular/core';
export const appConfig: ApplicationConfig = {
providers: [
importProvidersFrom(HttpClientModule),
]
};
# Limpar cache do NPM
npm cache clear
npm cache clear --force
# Atualizar dependencias
ng update
# COMANDOS PROD (frontend-area)
# Compila para Produção
ng build --output-path=../build-frontend-area --base-href="/area/"