Skip to content

Commit

Permalink
Updated the ReadME.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilpurav committed Jun 27, 2021
1 parent ce1493e commit 7762eb2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 17 deletions.
54 changes: 40 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
# NgxServerlessStarter
# Angular 12.x Serverless Starter

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.0.
This starter is intended for those who wish to run their application on AWS lambda with serverless framework.

## Development server
It is super easy and done with 100% adherance to all the recommendations by Angular and Serverless community.

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
# How to use?

## Code scaffolding
## Project naming

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
Starter comes up with it's own name, "ngx-serverless-starter". I'm sure this will not be the name for all of your project and you intend to change it with your project name. Follow this guide.

## Build
- You need to clone this repository.
- Find & replace the word "ngx-serverless-starter" with your project name.
- Update your root folder name.

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running application
Application has three major build types:

## Running unit tests
- Non SSR
- SSR
- Serverless

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
### Non SSR

## Running end-to-end tests
It is regular build without Angular Universal in picture.Use it for your day to day development since it is fairly fast as compared to SSR or serverless.

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
**Command**:
- `ng serve` - For local development build
- `ng build` - For production build

## Further help
### SSR

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
This is Angular Universal build without Serverless framework.

**Command**:
- `npm run dev:ssr` - For local development build
- `npm run build:ssr` - For production build

### Serverless

This is Angular Universal build with Serverless framework.

**Command**:
- `aws configure` - Configuring your AWS access keys
- `npm run dev:sls` - For local development build
- `npm run build:sls` - For production build
- `npm run deploy` - For deploying on serverless
- `npm run terminate` - For terminating infrastructure resources on AWS.


> For more information about this starter, head on to the article:
https://medium.com/cactus-techblog/deploy-angular-universal-on-aws-lambda-from-scratch-1b169289eac2
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
"watch": "ng build --watch --configuration development",
"test": "ng test",
"dev:ssr": "ng run ngx-serverless-starter:serve-ssr",
"dev:sls": "npm run build:sls && npm run serve:sls",
"dev:sls": "ng build -c development && ng run ngx-serverless-starter:serverless -c development && npm run serve:sls",
"serve:ssr": "node dist/ngx-serverless-starter/server/main.js",
"serve:sls": "serverless offline start --noPrependStageInUrl",
"build:ssr": "ng build && ng run ngx-serverless-starter:server",
"build:sls": "ng build -c development && ng run ngx-serverless-starter:serverless -c development",
"prerender": "ng run ngx-serverless-starter:prerender"
"build:sls": "ng build && ng run ngx-serverless-starter:serverless",
"prerender": "ng run ngx-serverless-starter:prerender",
"deploy": "serverless deploy",
"terminate": "serverless remove"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit 7762eb2

Please sign in to comment.