I created a REST API with Go and deployed it to vercel with github.com/tbxark/g4vercel.
我使用Go创建了一个rest API,并使用githeb.com/tbxark/g4vercel将其部署到Vercel。
This is my project structure:
这是我的项目结构:
- api > index.go
- go.mod
- go.sum
- vercel.json
- X (this is the CLI tool binary written in Golang)
Now, within the index.go
file, I have this code:
现在,在index.go文件中,我有以下代码:
cliPath := "./X"
helpCmd := exec.Command(cliPath, "--help")
But vercel cannot find this binary when executing the command above. It shows this error:
但Vercel在执行上述命令时找不到此二进制文件。它显示以下错误:
fork/exec ./X: no such file or directory
How to solve this issue? Thanks.
如何解决这个问题?谢谢。
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!