Added CallbackApp to better access backend.Backend from with in an App
Fixed issues with CORS not being able to do an OPTIONS request Fixed folders not being processed properly. Fixed some other issues.
This commit is contained in:
@@ -16,9 +16,8 @@ type BlogApp struct {
|
||||
conv *bbConvert.HTMLConverter
|
||||
}
|
||||
|
||||
func NewBlogApp(b *backend.Backend, db *mongo.Database) *BlogApp {
|
||||
func NewBlogApp(db *mongo.Database) *BlogApp {
|
||||
out := &BlogApp{
|
||||
back: b,
|
||||
blogCol: db.Collection("blog"),
|
||||
authCol: db.Collection("author"),
|
||||
portfolioCol: db.Collection("portfolio"),
|
||||
@@ -40,6 +39,10 @@ func (b *BlogApp) CrashTable() backend.CrashTable {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *BlogApp) AddBackend(back *backend.Backend) {
|
||||
b.back = back
|
||||
}
|
||||
|
||||
func (b *BlogApp) Extension(mux *http.ServeMux) {
|
||||
mux.HandleFunc("GET /blog", b.reqLatestBlogs)
|
||||
mux.HandleFunc("GET /blog/list", b.reqBlogList)
|
||||
|
||||
Reference in New Issue
Block a user