An example project demonstrating a web application that interacts with a serverless REST API deployment using Lard. This is the companion project to lard-example-crud-api.
-
API preparation
- Follow all the directions in the lard-example-crud-api README.
-
Angular preparation
- Install Angular CLI globally:
npm i -g @angular/cli
- Install Angular CLI globally:
-
Clone this repository and enter its directory:
git clone https://github.com/lafiosca/lard-example-crud-web.git && cd lard-example-crud-web
-
Run
npm i
to install the required node modules. -
Edit
bin/definitions.sh
as appropriate, only if you changed the default stack names in lard-example-crud-api. -
Run
bin/generate-configs.sh
to create a couple of config files referencing your development stack. -
Run
bin/generate-sdk.sh
to generate the library code for accessing your development API. -
Run
bin/manage-user-pool.sh
with the appropriate option values to establish a user for yourself in your development Cognito User Pool:bin/manage-user-pool.sh user create -u yourusername -n 'Your Name' -p +14045551234 -e 'your@email.address'
This command will prompt you to choose one from a list of generated passwords, and it will present you with a confirmation dialog before taking action. Record your username and password for use in the web application.
-
Run
ng serve
to start the local web application, pointing at your development stacks. -
Open http://localhost:4200/ in your web browser.
-
Log into the web application using the username and password from step 6 above.
-
Create, retrieve, update, and delete some notes using your new serverless API deployment.
When you are done, hit control-c in the terminal where your ng serve
command is running. You can delete the lard-example-crud-web project directory, but the API and related resources will still exist in your AWS account. Follow the cleanup directions in lard-example-crud-api when you are ready to remove them.