https://github.com/piercus/serverless-local-environment
Serverless Plugin to set local environment variables
https://github.com/piercus/serverless-local-environment
Last synced: about 1 year ago
JSON representation
Serverless Plugin to set local environment variables
- Host: GitHub
- URL: https://github.com/piercus/serverless-local-environment
- Owner: piercus
- Created: 2018-02-07T17:32:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-11T13:06:50.000Z (almost 8 years ago)
- Last Synced: 2025-03-18T15:12:41.925Z (about 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-serverless - Local environment - Set local environment variables. (Serverless Framework Plugins)
README
# Serverless local variables
This plugin helps you add some conf that will only work for `serverless invoke local`
This way :
* you can customize the behavior when running on local
* you can set another stage to use locally
* You can set variables like **LD_LIBRARY_PATH** to connact to your local environment
* You can mock your cloud ressource during your local tests
## Install
```
npm install --save-dev serverless-local-environment
```
## Usage
You can use it like
**serverless.yml**
```yml
plugins:
- serverless-local-environment
...
functions:
my-function:
handler: index.handler
stage: dev
environment:
ENV: dev
local-environment:
ENV: local
```
# About LD_LIBRARY_PATH
Aws serverless plugin set LD_LIBRARY_PATH to `'/usr/local/lib64/node-v4.3.x/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib'` (see https://github.com/serverless/serverless/blob/4b71faf2128308894646940ce2fb64e826450972/lib/plugins/aws/invokeLocal/index.js#L95), this library is adding this value to your local LD_LIBRARY_PATH values