https://github.com/ansforge/archetype-angular
https://github.com/ansforge/archetype-angular
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ansforge/archetype-angular
- Owner: ansforge
- Created: 2022-04-18T18:01:35.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-18T19:38:32.000Z (about 4 years ago)
- Last Synced: 2025-01-11T09:51:31.134Z (over 1 year ago)
- Language: CSS
- Size: 455 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Test environment:
- simulate a backend rest service to deliver mock data in json format with `Json Server`
`data.json` : contains the data which should be exposed by the rest api
- a server-side `proxy` is used to call the json server instead of the backend server
`proxy.conf.js`: contains the proxy rules
### Precondition:
- install json server (if it is not already done)
```
npm install -g json-server
```
#### Steps:
- run json server in terminal
```
json-server mock/data.json --port 3010
```
- set `API_URL` in environment.ts to `http://localhost:4200/`
- run the angular dev server (with the proxy config) in terminal
```
ng serve -c local
```
## Build and deploy the app in local:
- compile the application to the dist folder
```
ng build
```
add --prod with the production settings
```
ng build --prod
```
- install a web server `lite-server` (globally, if preferred)
```
npm install --global lite-server
```
- run the web server in local
```
lite-server --baseDir="dist/enreg"
```