2018-06-20 15:56:23 +03:00
..
2018-06-20 15:56:23 +03:00

Read this on the main serverless docs site

Serverless Platform (Beta)

The Serverless Platform is currently in experimental beta. If you'd like to participate in the beta, simply follow the instructions below.

Set-Up

Make sure you have Node.js installed and run:

$ npm i serverless -g

Then, check the version to make sure you are using V1.20.0, or later:

$ serverless -v

Usage

First, register or log in to the Serverless Platform in via the CLI

$ serverless login

After logging into the platform, make a note of your tenant, and create a new application by clicking on "+ App" button in the applications page.

Serverless Platform - Tenant Serverless Platform - Create Application

After creating your serverless application, add this application and your tenant to your service serverless.yml file:

service: my-service

tenant: eahefnawy
app: my-app

provider:
  name: aws
  runtime: nodejs6.10

functions:
  hello:
    handler: handler.hello
    events:
      - hello.world
      - http:
          path: hello/world
          method: post
          cors: true

Now that you've logged in and added your tenant and app, every time you deploy, your service will be published privately to the Serverless Platform:

$ serverless deploy

Then visit https://dashboard.serverless.com/ in your browser to view and manage your service.

Note: If this is your first deployment since you logged in, the framework will auto-create a platform access key for you named "Framework" and save it in your ~/.serverlessrc file. This access key is used for authentication when publishing your service.

Beta CLI Commands

Logging in to the platform enables access to beta features of the Serverless framework.

serverless run

Start local development mode for a Serverless service. This mode downloads and installs the event-gateway and the serverless emulator. Both of these are used to emulate a serverless service and develop against them locally.

serverless emit

Emit an event to an event-gateway.

serverless login

Register or log in to the platform.

serverless logout

Logout of the platform.