我已经在 Heroku 上部署了 Go 应用程序,但是在点击 url 时......它没有给出正确的响应。Heroku 日志看起来像这样:
2015-06-27T10:43:06.839094+00:00 heroku[web.1]: Starting process with command `FlickrImage`
2015-06-27T10:43:08.998400+00:00 heroku[web.1]: State changed from starting to crashed
2015-06-27T10:43:08.998400+00:00 heroku[web.1]: State changed from crashed to starting
2015-06-27T10:43:08.985737+00:00 heroku[web.1]: Process exited with status 0
2015-06-27T10:43:10.795684+00:00 heroku[web.1]: Starting process with command `FlickrImage`
2015-06-27T10:43:13.837301+00:00 heroku[web.1]: Process exited with status 0
2015-06-27T10:43:13.850141+00:00 heroku[web.1]: State changed from starting to crashed
2015-06-27T10:44:41.914412+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/Index" host=morning-ridge-1365.herokuapp.com request_id=89d2e794-a725-4ddf-b437-dbcbd988428c fwd="202.12.83.44" dyno= connect= service= status=503 bytes=
FlickrImage 是我的 go 文件,我创建了一个包含“web: FlickrImage”的 Procfile
编辑:FlickrImageServer 代码:
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"reflect"
"strconv"
"strings"
"github.com/gorilla/mux"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
type imageLinks struct {
Link string `bson:"link"`
Upvote int `bson:"upvote"`
Downvote int `bson:"downvote"`
}
任何帮助,将不胜感激
猛跑小猪
相关分类