Install a Cosmic-powered Serverless app in seconds 🔥
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts
views
.gitignore
README.md
app.js
package-lock.json
package.json
serverless.yml

README.md

Serverless Starter

Serverless Node.js starter app powered by Cosmic JS 🚀

Installation

Install via the Cosmic CLI.

npm i -g cosmic-cli

# Login to your Cosmic JS account
cosmic login

# Installs example content to a new or existing Bucket and downloads the app locally
cosmic init serverless-starter
cd serverless-starter

Install Serverless

Install Serverless and login.

npm i -g serverless
serverless login

Run locally

Start serverless server locally.

# starts app locally connected to your Cosmic JS Bucket
cosmic develop

Configure AWS credentials

Add your AWS keys. Follow the guide on the Serverless website for more instructions.

export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>

Deploy to AWS

Deploying to AWS is easy using the Serverless deploy command.

COSMIC_BUCKET=your-bucket-slug sls deploy