serverless-offline-express v0.4.3
Serverless Offline Express
A Serverless v1.x plugin to run HTTP and PubSub functions with Express.
This plugin is for you if you want to run offline multiple NodeJS/TypeScript functions, which use request and response Express framework.
Some of serverless services like Google Gloud Functions or Firebase Function use standard Express requests and response on HTTP function invocation, and this plugin allow to run them together offline and keep compatible develoment all Express based functions.
Highlights
- Configuration possibilities range from zero-config
 - Combine in same running Express process all HTTP and PubSub handlers
 - Support TypeScript functions execution
 - Express 4 support
 - Support NPM and Yarn for packaging
 - Hot Module Reload support
 - Emulate Message interface for PubSub functions
 
Install
$ npm install serverless-offline-express --save-devAdd the plugin to your serverless.yml file:
plugins:
  - serverless-offline-expressConfigure
Plugin not support yet any configuration.
Configure function
# serverless.yml
# Accessible by URL: /myFunction
functions:
  myFunction:
    handler: handlers/myHandlerFile.myFunctionName
    events:
      - http: 
          path: myHttpUrlPath
          method: GET|PUT|POST|DELETE
# Accessible by URL: /pubsub/myPubSubMessageTopic?message={"name":"test"}&attributes[name]=test_attribute
  myPubSubFunction:
    handler: handlers/anotherHandlerFile.myPubSubFunctionName
    events:
      - pubsub: 
          topic: myPubSubMessageTopicRun Express server
$ serverless expressEnvironment variables
- EXPRESS_HOST - Host name where Express will start
 - EXPRESS_PORT - Port where Express will start
 
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago