mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
updating routes with api additions
This commit is contained in:
parent
ce3ed4bc2c
commit
f691914eab
@ -28,13 +28,13 @@ type Routes []Route
|
|||||||
|
|
||||||
func NewRouter() *mux.Router {
|
func NewRouter() *mux.Router {
|
||||||
|
|
||||||
// populate context
|
// populate context
|
||||||
_configured = getBoolConfigValue(CONFIG_CONFIGURED, false);
|
_configured = getBoolConfigValue(CONFIG_CONFIGURED, false);
|
||||||
_adminUsername = getStrConfigValue(CONFIG_USERNAME, "");
|
_adminUsername = getStrConfigValue(CONFIG_USERNAME, "");
|
||||||
_adminPassword = getBinConfigValue(CONFIG_PASSWORD, nil);
|
_adminPassword = getBinConfigValue(CONFIG_PASSWORD, nil);
|
||||||
_nodeDomain = getStrConfigValue(CONFIG_DOMAIN, "");
|
_nodeDomain = getStrConfigValue(CONFIG_DOMAIN, "");
|
||||||
_publicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
|
_publicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
|
||||||
_accountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
|
_accountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
|
||||||
|
|
||||||
router := mux.NewRouter().StrictSlash(true)
|
router := mux.NewRouter().StrictSlash(true)
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
@ -99,6 +99,13 @@ var routes = Routes{
|
|||||||
GetAccountApps,
|
GetAccountApps,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Route{
|
||||||
|
"GetAccountAsset",
|
||||||
|
strings.ToUpper("Get"),
|
||||||
|
"/account/assets/{assetId}",
|
||||||
|
GetAccountAsset,
|
||||||
|
},
|
||||||
|
|
||||||
Route{
|
Route{
|
||||||
"GetAccountDid",
|
"GetAccountDid",
|
||||||
strings.ToUpper("Get"),
|
strings.ToUpper("Get"),
|
||||||
@ -148,6 +155,13 @@ var routes = Routes{
|
|||||||
GetPublicClaimable,
|
GetPublicClaimable,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Route{
|
||||||
|
"RemoveAccount",
|
||||||
|
strings.ToUpper("Delete"),
|
||||||
|
"/account/profile",
|
||||||
|
RemoveAccount,
|
||||||
|
},
|
||||||
|
|
||||||
Route{
|
Route{
|
||||||
"RemoveAccountApp",
|
"RemoveAccountApp",
|
||||||
strings.ToUpper("Delete"),
|
strings.ToUpper("Delete"),
|
||||||
@ -176,6 +190,13 @@ var routes = Routes{
|
|||||||
SetAccountExport,
|
SetAccountExport,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Route{
|
||||||
|
"SetAccountNode",
|
||||||
|
strings.ToUpper("Put"),
|
||||||
|
"/account/node",
|
||||||
|
SetAccountNode,
|
||||||
|
},
|
||||||
|
|
||||||
Route{
|
Route{
|
||||||
"AddNodeAccount",
|
"AddNodeAccount",
|
||||||
strings.ToUpper("Post"),
|
strings.ToUpper("Post"),
|
||||||
@ -247,7 +268,7 @@ var routes = Routes{
|
|||||||
},
|
},
|
||||||
|
|
||||||
Route{
|
Route{
|
||||||
"Authenticate",
|
"Authorize",
|
||||||
strings.ToUpper("Put"),
|
strings.ToUpper("Put"),
|
||||||
"/authorize",
|
"/authorize",
|
||||||
Authorize,
|
Authorize,
|
||||||
|
@ -12,6 +12,7 @@ func AutoMigrate(db *gorm.DB) {
|
|||||||
db.AutoMigrate(&Card{});
|
db.AutoMigrate(&Card{});
|
||||||
db.AutoMigrate(&CardGroup{});
|
db.AutoMigrate(&CardGroup{});
|
||||||
db.AutoMigrate(&LabelGroup{});
|
db.AutoMigrate(&LabelGroup{});
|
||||||
|
db.AutoMigrate(&Asset{});
|
||||||
db.AutoMigrate(&Article{});
|
db.AutoMigrate(&Article{});
|
||||||
db.AutoMigrate(&ArticleAsset{});
|
db.AutoMigrate(&ArticleAsset{});
|
||||||
db.AutoMigrate(&ArticleTag{});
|
db.AutoMigrate(&ArticleTag{});
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
app "databag/internal"
|
app "databag/internal"
|
||||||
store "databag/internal/store"
|
"databag/internal/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user