This is a sample to frontend with Angular. The repositories for sample of backend are API and Infrastructure.
Clone the Repository:
$ git clone https://github.com/nihemak/aws-sls-spa-sample-web.git sample-spa-web
$ cd sample-spa-web
Build docker environment:
$ npm run docker-build
Invoke ng serve
in docker environment:
$ npm run docker-up-dev
$ npm run docker-serve
Access to frontend:
To stop the docker, execute the following:
$ npm run docker-down
Connect to aws-sls-spa-sample-api
Start aws-sls-spa-sample-api of Docker:
See: aws-sls-spa-sample-api.
Change API_BASE_URL
of environment variable in docker to aws-sls-spa-sample-api's URL('http://localhost:3000'):
$ git diff dockers/docker-compose.yml
angular:
build: ./angular
tty: true
ports:
- 4200:4200
environment:
- API_BASE_URL: 'mock-server'
+ API_BASE_URL: 'http://localhost:3000'
volumes:
- ../:/src/
Invoke ng serve
in docker environment:
$ npm run docker-up-dev
$ npm run docker-serve
Access to frontend:
To stop the docker, execute the following:
$ npm run docker-down