寻高手帮忙搭建在线运行代码的API(有报酬)

ypchen · · 5527 次点击
curl --request POST \ --header 'Authorization: Token 0123456-789a-bcde-f012-3456789abcde' \ --header 'Content-type: application/json' \ --data '{"files": [{"name": "main.py", "content": "print(42)"}]}' \ --url 'https://run.glot.io/languages/python/latest' 这个请求就是运行代码的请求,你直接用你提到的这个第三方就可以了,自己实现也很简单,报酬就不必了,太容易了。我给你那个就是前台调用的接口,你跟你们前台一说他就懂了啊。 如果自己实现,就是把代码放在 content 里面,你在后台生成一个代码文件,然后执行以下 go run 命令,把结果返回去就行了。望楼主创业成功
#4
更多评论
Golang.org官网的tour就是这个模式 https://tour.golang.org/welcome/1
#2