1.0.3 • Published 4 years ago

@twn39/tencent-hapi v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Serverless Components

Serverless tencent hapi component.

Install

  1. global install serverless
npm install -g serverless
  1. install hapi
npm install @hapi/hapi --save

Configure

  1. create app.js file:
const Hapi = require('@hapi/hapi');

const app = Hapi.server({ port: 80 });
app.route({
    method: 'GET',
    path: '/',
    handler: (request, h) => {
        return h.response({
            hello: 'hapi',
        });
    },
});

module.exports = app;
  1. create serverless configure file:
# serverless.yml

hapi:
  component: '@twn39/tencent-hapi'
  inputs:
    region: ap-shanghai

Deploy

sls --debug

Have fun !