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

@serverless/tencent-apig

v1.7.0

Published

Tencent Cloud API Gateway

Downloads

8

Readme

tencent-apigateway

Easily provision Tencent API Gateway using Serverless Components.

  1. Install
  2. Create
  3. Configure
  4. Deploy

1. Install

$ npm install -g serverless

2. Create

Just create the following simple boilerplate:

$ touch serverless.yml 
$ touch .env           # your Tencent api keys

If you don't have a Tencent Cloud account, you could sign up first.

If you already login in, find TENCENT_SECRET_ID and TENCENT_SECRET_KEY in Tencent Console.

# .env
TENCENT_SECRET_ID=XXX
TENCENT_SECRET_KEY=XXX

3. Configure

# serverless.yml

restApi:
  component: "@serverless/tencent-apig"
  inputs:
    # serviceId: service-8dsikiq6 # if you don't want to use a api-gateway which exists, please do not add serviceId
    region: ap-shanghai # default ap-guangzhou
    protocol: http #  http | https | http&https
    # serviceName: sls # up to 50 characters,(a-z,A-Z,0-9,_)
    description: the sls service 
    environment: release 
    endpoints: # need at least one endpoints
      - path: /users  # required
        method: POST  # required
        function:
          functionName: aaa # required
      - path: /test
        apiId: api-id # if you don't want to use a api-gateway which exists, please do not add serviceId
        method: GET
        description: Serverless REST API
        enableCORS: TRUE 
        function:
          isIntegratedResponse: TRUE 
          functionQualifier: $LATEST 
          functionName: fist # required
        usagePlan:
          # if dont't exists create a new 
          usagePlanId: 1111
          usagePlanName: slscmp # required
          usagePlanDesc: sls create
          maxRequestNum: 1000
        auth:
          serviceTimeout: 15
          secretName: secret  # required
          # secretIds:
          #   - AKIDNSdvdFcJ8GJ9th6qeZH0ll8r7dE6HHaSuchJ

4. Deploy

$ serverless

 

Test

tongtingting:tencent-apigateway tongtingting$ sls

restApi: 
    protocol:      HTTP
    serviceId:     service-********
    subDomain:     service-********-**********.ap-guangzhou.apigateway.myqcloud.com
    requestConfig: 
      path:   /frontend/path
      method: GET
    identity: 
      secretIds: 
        - AKID************************

  16s › restApi › done
  
tongtingting:tencent-api-gateway tongtingting$ sls remove

  19s › restApi › done

New to Components?

Checkout the Serverless Components repo for more information.