Skip to content

Commit

Permalink
Updating with SST info
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair authored Oct 7, 2020
1 parent 2279c4d commit f745273
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

This repo is for the serverless backend API that we build over the course of the tutorial. You can find the repo for the frontend React app [here](https://github.com/AnomalyInnovations/serverless-stack-demo-client). And the repo for the tutorial [here](https://github.com/AnomalyInnovations/serverless-stack-com).

This repo is split into:

- **services**: [Serverless Framework](https://github.com/serverless/serverless) services
- **infrastructure**: An [SST](https://github.com/serverless-stack/serverless-stack) app

#### Steps

To support the different chapters and steps of the tutorial; we use branches to represent the project codebase at the various points. Here is an index of the various chapters and branches in order.
Expand All @@ -20,14 +25,31 @@ To use this repo locally you need to have the [Serverless framework](https://ser
$ npm install serverless -g
```

Clone this repo and install the NPM packages.
Clone this repo.

```bash
$ git clone https://github.com/AnomalyInnovations/serverless-stack-demo-api
```

Head over to the `infrastructure/` directory and install the npm packages.

``` bash
$ npm install
```

Run a single API on local.
And build the SST app.

``` bash
$ npx sst build
```

Then deploy it to your AWS account

``` bash
$ npx sst deploy
```

Then head over to `services/notes/`. And run a single API endpoint locally.

```bash
$ serverless invoke local --function list --path event.json
Expand All @@ -47,13 +69,13 @@ Where, `event.json` contains the request event info and looks something like thi
}
```

Finally, run this to deploy to your AWS account.
Finally, run this to deploy to the API to your AWS account.

```bash
$ serverless deploy
```

This project refers to an `.env` file for secret environment variables that are not checking in to the repo. Make sure to create one before dpeloying - https://serverless-stack.com/chapters/load-secrets-from-env.html.
The API service refers to an `.env` file for secret environment variables that are not checking in to the repo. Make sure to create one before deploying - https://serverless-stack.com/chapters/load-secrets-from-env.html.

---

Expand Down

0 comments on commit f745273

Please sign in to comment.