mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +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 {
|
||||
|
||||
// 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,
|
||||
|
@ -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{});
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
app "databag/internal"
|
||||
store "databag/internal/store"
|
||||
"databag/internal/store"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
Loading…
Reference in New Issue
Block a user