npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sails-run-deploy-serverless

v0.3.5

Published

Sails command to deploy actions as AWS Lambda functions via the Serverless framework

Downloads

27

Readme

sails-run-deploy-serverless

A Sails command to deploy actions as AWS Lambda functions via the Serverless toolkit.

Usage

First, install Serverless:

npm install -g serverless

and follow the instructions for setting your AWS credentials.

Then, install this command in your Sails app:

npm install sails-run-deploy-serverless

and invoke using sails run deploy-serverless <options>.

Options

The available options (you must choose one and only one) are:

  • --all: deploy (or redeploy) all functions. You may need to do this when first adding a new endoint, or modifying the URL of an existing one.
  • --f <function name>: deploy only the function with the specified name. Function names are the camel-cased version of the action name in Sails; for example, the action in api/controllers/user/get.js corresponds to a function named userGet.
  • --nodeploy: just generate the serverless folder, but don't actually deploy. You can then go into the folder and deploy yourself with the Serverless CLI.

Note that every time you run the command, the local serverless folder is recreated.

Datastores

TODO: document serverless-dev and serverless-prod

Authorizers

TODO: document route authorization

CORS

TODO: document CORS

Configuration

config/serverless.js

This file allows you to declare which parts of your Sails app should be copied into the package that is deployed to AWS. Available settings are:

  • include: An array of file or folder paths (relative to the project root) to copy into the deployment package. Defaults to ['api/controllers', 'api/helpers', 'api/models', 'config/models.js', 'config/datastores.js'].

  • transpile: An array of file or folder paths (relative to the project root) to transpile to ES5 before deploying. At this time, Lambda only supports Node 6. Defaults to ['api/controllers', 'api/helpers', 'api/models'].

  • defaultAuthorizer: The name of an authorizer function to use as the default for any route that doesn't explicitly set an authorizer option. If left unset, routes will not be authorized by default.

  • orm: Set to false if you don't want the deployed Lambda functions to use the Waterline ORM.

config/serverless.yml

This command creates a serverless.yml file with some sane defaults. If you create a config/serverless.yml file in your app, it will be used as the basis for the YML file that the deploy-serverless command creates. This is useful for setting up environment variables, VPCs, AWS Gateway Responses, etc.

Links

Serverless
Sails