https://github.com/iliasbhal/serverless-static
:package: serverless framework plugin - serve / deploy static files that works with serverless-offline plugin
https://github.com/iliasbhal/serverless-static
aws-lambda localhost s3 serverless
Last synced: 10 months ago
JSON representation
:package: serverless framework plugin - serve / deploy static files that works with serverless-offline plugin
- Host: GitHub
- URL: https://github.com/iliasbhal/serverless-static
- Owner: iliasbhal
- Created: 2018-02-03T05:51:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-04T07:00:06.000Z (about 6 years ago)
- Last Synced: 2025-05-07T21:46:51.166Z (10 months ago)
- Topics: aws-lambda, localhost, s3, serverless
- Language: JavaScript
- Homepage:
- Size: 551 KB
- Stars: 13
- Watchers: 0
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# :package: :sparkles: Serverless Static Plugin
[](http://www.serverless.com)
## Note
Deploy functionality is in active development, it soon will be available
## 1.install the plugin
First, add Serverless Static to your project, be sure that you already have the [serverless-offline](https://github.com/dherault/serverless-offline) plugin already installed
```
$ npm install serverless-static --save-dev
```
> or, if serverless-offline is not already installed
```
$ npm install serverless-static serverless-offline --save-dev
```
## 2. add it to your serverless.yml file
Then inside your project's serverless.yml file add following entry to the plugins section: serverless-static. If there is no plugin section you will need to add it to the file.
It should look something like this:
```YAML
plugins:
- serverless-offline
- serverless-static
```
## 3. customize behavior (optional)
```YAML
custom:
static:
path: ./public # select the folder you want to serve
port: 8000 # select a specific port
# this will overide default behavior
# it will serve the folder ./public
# it will serve it throught localhost:8000
```