More work on stuff

This commit is contained in:
Caleb Gardner
2024-06-28 07:04:10 -05:00
parent 5db8692ec8
commit 5af5de7719
8 changed files with 34 additions and 24 deletions
+4
View File
@@ -3,6 +3,7 @@ package blog
import (
"net/http"
"github.com/CalebQ42/bbConvert"
"github.com/CalebQ42/darkstorm-server/internal/backend"
"go.mongodb.org/mongo-driver/mongo"
)
@@ -11,6 +12,7 @@ type BlogApp struct {
back *backend.Backend
blogCol *mongo.Collection
authCol *mongo.Collection
conv *bbConvert.HTMLConverter
}
func NewBlogApp(b *backend.Backend, db *mongo.Database, mux *http.ServeMux) *BlogApp {
@@ -18,7 +20,9 @@ func NewBlogApp(b *backend.Backend, db *mongo.Database, mux *http.ServeMux) *Blo
back: b,
blogCol: db.Collection("blog"),
authCol: db.Collection("author"),
conv: &bbConvert.HTMLConverter{},
}
out.conv.ImplementDefaults()
// setup mux
mux.HandleFunc("GET /blog", out.LatestBlogs)
mux.HandleFunc("GET /blog/list", out.BlogList)