updating routes with api additions

This commit is contained in:
Roland Osborne 2022-01-13 13:14:30 -08:00
parent ce3ed4bc2c
commit f691914eab
3 changed files with 31 additions and 9 deletions

View File

@ -28,13 +28,13 @@ type Routes []Route
func NewRouter() *mux.Router {
// populate context
_configured = getBoolConfigValue(CONFIG_CONFIGURED, false);
_adminUsername = getStrConfigValue(CONFIG_USERNAME, "");
_adminPassword = getBinConfigValue(CONFIG_PASSWORD, nil);
_nodeDomain = getStrConfigValue(CONFIG_DOMAIN, "");
_publicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
_accountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
// populate context
_configured = getBoolConfigValue(CONFIG_CONFIGURED, false);
_adminUsername = getStrConfigValue(CONFIG_USERNAME, "");
_adminPassword = getBinConfigValue(CONFIG_PASSWORD, nil);
_nodeDomain = getStrConfigValue(CONFIG_DOMAIN, "");
_publicLimit = getNumConfigValue(CONFIG_PUBLICLIMIT, 0);
_accountStorage = getNumConfigValue(CONFIG_STORAGE, 0);
router := mux.NewRouter().StrictSlash(true)
for _, route := range routes {
@ -99,6 +99,13 @@ var routes = Routes{
GetAccountApps,
},
Route{
"GetAccountAsset",
strings.ToUpper("Get"),
"/account/assets/{assetId}",
GetAccountAsset,
},
Route{
"GetAccountDid",
strings.ToUpper("Get"),
@ -148,6 +155,13 @@ var routes = Routes{
GetPublicClaimable,
},
Route{
"RemoveAccount",
strings.ToUpper("Delete"),
"/account/profile",
RemoveAccount,
},
Route{
"RemoveAccountApp",
strings.ToUpper("Delete"),
@ -176,6 +190,13 @@ var routes = Routes{
SetAccountExport,
},
Route{
"SetAccountNode",
strings.ToUpper("Put"),
"/account/node",
SetAccountNode,
},
Route{
"AddNodeAccount",
strings.ToUpper("Post"),
@ -247,7 +268,7 @@ var routes = Routes{
},
Route{
"Authenticate",
"Authorize",
strings.ToUpper("Put"),
"/authorize",
Authorize,

View File

@ -12,6 +12,7 @@ func AutoMigrate(db *gorm.DB) {
db.AutoMigrate(&Card{});
db.AutoMigrate(&CardGroup{});
db.AutoMigrate(&LabelGroup{});
db.AutoMigrate(&Asset{});
db.AutoMigrate(&Article{});
db.AutoMigrate(&ArticleAsset{});
db.AutoMigrate(&ArticleTag{});

View File

@ -13,7 +13,7 @@ import (
"log"
"net/http"
app "databag/internal"
store "databag/internal/store"
"databag/internal/store"
)
func main() {