https://github.com/bytedance/douyincloud-nodejs-koa-demo

https://github.com/bytedance/douyincloud-nodejs-koa-demo

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (3.2%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: bytedance
  • License: other
  • Language: TypeScript
  • Default Branch: main
  • Size: 18.6 KB
Statistics
  • Stars: 7
  • Watchers: 2
  • Forks: 38
  • Open Issues: 0
  • Releases: 0
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

douyincloud-nodejs-koa-demo

本项目是抖音云平台基于 Nodejs koa 框架的开发模版,模版通过使用 Redis 和 MongoDB 实现了简单的 hello-world 功能。\ 抖音云平台支持基于 Git 代码和 Docker 镜像部署两种方式。其中,Dockerfile 文件可以参考本项目中的 Dockerfile 文件。 部署在抖音云平台的服务日志需要重定向到标准输出,并在抖音云平台日志功能中查看。

目录结构

~~~ . ├── Dockerfile Dockerfile文件 ├── Readme.md Readme文件 ├── src 源码目录 │ ├── server.ts 应用入口文件 ├── run.sh 容器运行时启动文件 ├── package.json npm 包管理文件 ~~~

请求方法

前往抖音云托管平台「调试」功能界面,进行请求调试。

API说明

POST /api/set_data_to_redis?key=test

调用 redis 组件设置数据,其中 key 通过 query 传递,value 在 HTTP request body中传递

请求参数

  • value:string 写入redis的数据

响应结果

json { "success": true, }

GET /api/get_data_from_redis?key=test

调用 redis 组件获取 value

请求参数

  • key:string redis key

响应结果

json { "success": true, "data": "", }

POST /api/set_data_to_mongodb?name=test

调用 mongodb 组件写入数据

请求参数

  • name:string 写入mongodb的数据

响应结果

json { "success": true, }

GET /api/get_data_from_mongodb?name=test

调用 mongodb 组件获取数据

请求参数

  • name:string

响应结果

json { "success": true, "data": {}, }

组件使用注意事项

在抖音云托管平台上启用组件后,抖音云平台会自动将组件的地址,账号,密码以环境变量的方式注入到容器中。\ 以Redis为例,在抖音云托管平台启用Redis组件后,平台会生成 REDIS_ADDRESSREDIS_USERNAMEREDIS_PASSWORD三个环境变量,在业务代码中可以使用如下代码获取相应值。 js const redisAddr = process.env.REDIS_ADDRESS; const redisUserName = process.env.REDIS_USERNAME; const redisPassword = process.env.REDIS_PASSWORD;

License

This project is licensed under the Apache-2.0 License.

Owner

  • Name: Bytedance Inc.
  • Login: bytedance
  • Kind: organization
  • Location: Singapore

GitHub Events

Total
  • Watch event: 3
  • Fork event: 19
Last Year
  • Watch event: 3
  • Fork event: 19

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 3
  • Total Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
limenglei01 l****i@b****m 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels