Giter Site home page Giter Site logo

reklesswang / apaas-token Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timmerse/apaas-token

0.0 0.0 0.0 26 KB

For generating the aPaaS token of timmerse.

Home Page: https://www.npmjs.com/package/timmerse

License: MIT License

Makefile 4.63% HTML 1.08% JavaScript 93.29% Shell 1.00%

apaas-token's Introduction

apaas-token

The backend to generate token for Timmerse SDK.

Directions

Activate the following Tencent Cloud services:

  • API Gateway, which allows you to access cloud functions and use HTTP APIs
  • COS, which offers storage for your cloud function code
  • CLS, which helps you manage the logs of your cloud functions
  • SCF, which allows your cloud functions to access other Tencent Cloud services

Run the command below to install Serverless Framework:

npm install -g serverless
npm install

Note: For directions on how to install Serverless Framework, see Installation.

Note: About the installation of Node.js, see Downloads. On Windows, instead of using PowerShell, you need to launch Node.js command prompt as Administrator.

Create an environment variable file .env. Replace xxx with the actual application ID and key.

APAAS_APPID=xxxxxxxxxxxxxxxx
APAAS_SECRET=xxxxxxxxxxxxxxxx

Note: To apply for a developer application ID and key, contact us at [email protected].

Deploy your cloud function. To grant the necessary access, scan the QR code or configure the key locally.

npm install
sls deploy

Note: On Windows, in order to be able to scan the QR code to grant the necessary access, you need to launch Node.js command prompt as Administrator.

Access the API https://{YOUR_SERVICE}.apigw.tencentcs.com/base/v1/apaas/token?userId=12345678 from a client to get the apaasToken.

apaasToken

Note: You can also get the apaasToken by opening your gateway address in a browser, as shown above.

FAQs

Q: How do I view the logs of my cloud function?

A: You can view the logs of cloud functions here.

Q: How do I delete a cloud function?

A: Run the command sls remove to delete a cloud function.

Q: What should I do if API Gateway returns SystemError(99): Invalid TRTC config?

A: Check if you changed the name of the .env file (you must not change the filename) and whether the TRTC application ID (TRTC_TIM_APPID) and key (TRTC_TIM_SECRET) were correctly configured.

Q: What should I do if I can’t access API Gateway or SCF?

A: Make sure you have activated the services and your account does not have overdue payment.

Q: What should I do if I fail to deploy my cloud function on Windows?

A: Launch Node.js command prompt as Administrator. Do not use PowerShell.

Q: How do I know whether I have created a gateway successfully?

A: If you can access the gateway https://{YOUR_SERVICE}.apigw.tencentcs.com/helloworld in a browser, then it’s created successfully.

Q: How do I know whether I have created a function successfully?

A: If you can access the function https://{YOUR_SERVICE}.apigw.tencentcs.com/helloworld in a browser, then it’s created successfully.

apaas-token's People

Contributors

reklesswang avatar winlinvip avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.