Comments (3)
自行解决了运行问题:
1、README中说明go run main 不行,在我的环境中需要将扩展名写全,go run main.go
2、数据库wxcomponent需要手动创建,创建后才能运行go run main.go,否则报错找不到数据库
3、需要安装nodejs,并且在client/html/下运行npm install 以及npm run build,否则提示dist/index.html找不到
4、根据日志打印看出由于80端口被占用,同时监听了8081端口;配置相应的nginx转发规则后,浏览器中输入地址后报404,输入/index.html也同样404,没头绪中...
以上内容未在README中体现,希望更新至README文档中,以便后面来的朋友运行顺利
问题4望wx方技术大佬指点,难道还需要配置其他什么?继续学习微信第三方文档ing
from wxcloudrun-wxcomponent.
问题4也自行解决了,main.go代码中监听的两个端口,分内部服务和外部服务(现阶段不明白这俩分别是干啥的)。
修改80端口为未占用端口后成功运行。
出现问题5。。登录账号密码是啥?
登录数据库查询到账号是root,密码加密了。。跟着inits.go挨个看代码。。终于找到,账号密码就是在.env中配置的数据库账号密码。。
目前已经成功运行并且登录进去了,继续探索中。。
最后,还是希望作者可以进一步完善文档,让后面的朋友少走弯路,谢谢
from wxcloudrun-wxcomponent.
后续:
由于后台运行该服务,该服务也会把日志直接输出到终端界面,太霸道了。。看到有dockfile,就考虑用docker的方式部署,这里记录一点细节,供后面的朋友方便
1、.env文件配置的数据库配置在容器中读取不到,docker运行后会发现连接数据库失败,容器中连接的数据库地址是127.0.0.1,而我在.env中已经改了相应的数据库容器IP了;代码中看到是获取环境变量的方式来读取配置,所以我这里修改dockfile,将数据库配置写到dockfile里面(当然也可以使用docker-compose的方式,写在docker-compose文件中,运行时加载环境变量,再或者直接在docker run 加参数...不再敖述);
2、dockerfile中使用的是npm安装前端依赖并打包,我服务器上已经安装过cnpm并已经安装依赖并打包出dist目录,所以修改了dockfile中的内容,将npm install那行注释掉了(其实也可以修改去掉nodejs的镜像依赖,需要修改下面的复制逻辑),不注释掉的话npm install会非常的慢(笔者就是等了5分钟没耐心了除此下策)。当然,也可以修改dockerfile去安装cnpm,其他方法自行发挥吧,继续探索了,good luck
from wxcloudrun-wxcomponent.
Related Issues (20)
- 可以操作小程序提审、发布吗 HOT 2
- 小程序重新授权后authorizer_access_token不会自动刷新
- 更新到v2.2之后,获取列表的时候异步更新数据库更新全部数据会清空之前的一些信息 HOT 1
- [需求]授权链接生成器中【H5 版授权链接】是否可以新增一个显示的二维码
- component_verify_ticket回调被wxsource middleware拦截? HOT 2
- 会提供php版本的不? HOT 1
- star一下,长期看好
- 部署完之后,访问授权连接,报41001 access_token missing rid HOT 3
- 此软件支持部署在本地使用吗? HOT 3
- 在腾讯云托管中部署后-系统默认管理员账号密码是多少?
- 获取授权链接访问后报错502 HOT 1
- 开发辅助-开发调试-获取component_access_token报错 HOT 2
- package main is not in GOROOT HOT 1
- error TS2339: Property 'startTransition' does not exist on type 'typeof React'.
- 静态资源存储和微信云托管是否在同一个内网环境
- 我手撸了一个PHP版本的,欢迎star
- Dockerfile中阿里镜像地址更新为https://registry.npmmirror.com/
- 最新版本发布失败 HOT 3
- 您好,我使用本地搭建的方式根本不能用! HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wxcloudrun-wxcomponent.