https://github.com/fun-stack/local-env
Replicate fun-stack infrastructure locally
https://github.com/fun-stack/local-env
aws aws-apigateway aws-lambda
Last synced: 5 months ago
JSON representation
Replicate fun-stack infrastructure locally
- Host: GitHub
- URL: https://github.com/fun-stack/local-env
- Owner: fun-stack
- License: mit
- Created: 2021-12-01T08:57:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-01T16:04:15.000Z (over 1 year ago)
- Last Synced: 2025-08-30T16:17:59.454Z (10 months ago)
- Topics: aws, aws-apigateway, aws-lambda
- Language: Scala
- Homepage:
- Size: 451 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# local-env
Replicate fun-stack infrastructure locally: AWS lambdas with a HTTP/WS Server, local cognito.
## Links
Example on how to use it:
- Fun Scala Template: [example](https://github.com/fun-stack/example)
Terraform module for the corresponding AWS infrastructure:
- Fun Terraform Module: [terraform-aws-fun](https://github.com/fun-stack/terraform-aws-fun)
SDK library to communicate with the infrastructure in your code:
- Fun SDK Scala: [sdk-scala](https://github.com/fun-stack/sdk-scala)
## Install
```sh
npm install --global @fun-stack/fun-local-env
```
## Usage
```sh
fun-local-env --help
```
Usage:
```
Usage: fun-local-env
--http []
--ws []
--auth []
--http-api
--http-rpc
--ws-rpc
--ws-event-authorizer
```
## Development
```sh
sbt ~cli/fastOptJS/webpack
node cli/target/scala-2.13/scalajs-bundler/main/fun-local-env.js --ws 8080 --ws-rpc handlerWebsocket
# or, with file watching:
echo cli/target/scala-2.13/scalajs-bundler/main/fun-local-env.js | entr -cnr node --enable-source-maps cli/target/scala-2.13/scalajs-bundler/main/fun-local-env.js --ws 8080 --ws-rpc handlerWebsocket
```
## Release
```sh
cd npm
mkdir -p .git # trick npm into thinking this is a git root
npm version patch
git push
git push --tags
```
## Caveats
If you're using a node-version that's too new (>16.x), you might need to set this env-var if you get errors bundling the app.
```sh
export NODE_OPTIONS=--openssl-legacy-provider
```