Giter Club home page Giter Club logo

tcb-starter's Introduction

Waline 是一款基于 Valine 衍生的简洁、安全的评论系统,该项目是使用云开发的一个 Waline 应用示例,可以基于 CloudBase Framework 框架将项目一键部署到云开发环境。

开发者信息

本应用由 @lizheming 开发提供

使用

DEMO

部署

本项目基于腾讯开源项目 CloudBase Framework star 开发部署,支持一键云端部署

点击下方按钮使用 CloudBase Framework 可以在云端一键部署本项目到自己的云开发账号上。

配置

关于项目更多的配置项,可查看 服务端配置

开发

你也可以下载项目后,使用 CloudBase CLI 在终端中一键部署。

tcb framework deploy --verbose -e 环境id

文档

tcb-starter's People

Contributors

binggg avatar eallion avatar lizheming avatar luckyqiao avatar renovate-bot avatar renovate[bot] avatar yuangezhizao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tcb-starter's Issues

一键部署后会出现报错,无法使用

通过一键部署后,会出现如下报错
错误码: INVOKE_FUNCTION_FAILED
错误信息: Code: -1 ScfRequestId: c54e0727-6396-11ee-b3fe-52540043f6d7 Error: /var/user/node_modules/think-model-mysql2/node_modules/lru-cache/dist/cjs/index.js:359 #initializeTTLTracking() { ^ SyntaxError: Unexpected token '(' at wrapSafe (internal/modules/cjs/loader.js:1072:16) at Module._compile (internal/modules/cjs/loader.js:1122:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/var/user/node_modules/think-model-mysql2/node_modules/lru-cache/dist/cjs/index-cjs.js:5:36) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
无法使用

其次,腾讯云cloudbase更新新版控制台后,需要将页面设置为旧版控制台页面才会弹出快速部署选项弹窗,否则没有任何反应

一键部署到云开发后,大概率报错404

类似
{"errno":404,"errmsg":"url /waline/ui/profile not found."}
{"errno":404,"errmsg":"url /waline not found."}

查看日志如下报错内容
START RequestId:e5164189-bb08-11eb-9728-525400a8c4bb

e5164189-bb08-11eb-9728-525400a8c4bb {message:url /waline/ui/profile not found.}

2021-05-22 22:20:44 e5164189-bb08-11eb-9728-525400a8c4bb {"traceId":"322f03ef3265419bb72e771f6cde0615","httpPath":"/waline/ui/profile","childOf":"","source":"http","invoker":"","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","invokerIp":"106.117.252.156","spanId":"80200e832cec88d6","service":"function","domain":"waline-8gawvfor4ef6d931-1252617797.ap-shanghai.app.tcloudbase.com","startTime":"1621693244246","event":"GET","timeCost":"25","statusCode":"404"}

REPORT RequestId:e5164189-bb08-11eb-9728-525400a8c4bb Duration:2ms Memory:128MB MemUsage:80.832031MB

END RequestId:e5164189-bb08-11eb-9728-525400a8c4bb

增加node版本声明

建议在 tcb-starter 添加指定版本:

{
    "version": "2.0",
    "envId": "{{envId}}",
    "$schema": "https://framework-1258016615.tcloudbaseapp.com/schema/latest.json ",
    "framework": {
        "name": "waline",
        "plugins": {
            "node": {
                "use": "@cloudbase/framework-plugin-node",
                "inputs": {
                    "entry": "app.js",
                    "name": "waline",
                    "path": "/waline",
                    "runtime": "Nodejs12.16"
                }
            }
        }
    }
}

最初由 JaxsonWang 在 walinejs/waline#478 (comment) 发布

部署报错

image
一键部署访问报这个错误是怎么回事?
image
查看日志是这样子的

无法创建部署,会报错

提示 未获取到cloudbaserc.json文件,将使用推荐配置
如果用命令行部署,则提示无函数

tcb fn deploy -e walinexxxxxxxxxxxxxxx
CloudBase CLI 1.2.5
CloudBase Framework 1.6.0
? 没有指定需要部署的云函数,是否部署配置文件中的全部云函数? Yes
✔ 成功部署 0 个函数

按照文档npx @cloudbase/cli -e xxxx 则提示 没有-e选项

后台管理路径问题

基于CloudBase的后台管理中,评论以及个人设置仍指向主域名子目录,而不是子目录 (/waline) 后一级。

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.