mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
Update/root url (#136)
* handle root url * add handler file * fix compilation bug * fix compilation error * attempt redirect * add query param of hostname * add name to root query params * cleanup
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/ RootR GET
|
||||
|
||||
-- EOS API V0
|
||||
/eos/v0/latest EosVersionR GET -- get eos information
|
||||
/eos/v0/eos.img EosR GET -- get eos.img
|
||||
/eos/v0/latest EosVersionR GET -- get eos information
|
||||
/eos/v0/eos.img EosR GET -- get eos.img
|
||||
|
||||
-- PACKAGE API V0
|
||||
/package/#ApiVersion/info InfoR GET -- get all marketplace categories
|
||||
@@ -15,9 +17,9 @@
|
||||
/package/#ApiVersion/version/#PkgId PkgVersionR GET -- get most recent appId version
|
||||
|
||||
-- ADMIN API V0
|
||||
/admin/v0/upload PkgUploadR POST !admin
|
||||
/admin/v0/eos-upload EosUploadR POST !admin
|
||||
/admin/v0/index PkgIndexR POST !admin
|
||||
/admin/v0/deindex PkgDeindexR GET POST !admin
|
||||
/admin/v0/category/#Text CategoryR POST DELETE !admin
|
||||
/admin/v0/categorize/#Text/#PkgId PkgCategorizeR POST DELETE !admin
|
||||
/admin/v0/upload PkgUploadR POST !admin
|
||||
/admin/v0/eos-upload EosUploadR POST !admin
|
||||
/admin/v0/index PkgIndexR POST !admin
|
||||
/admin/v0/deindex PkgDeindexR GET POST !admin
|
||||
/admin/v0/category/#Text CategoryR POST DELETE !admin
|
||||
/admin/v0/categorize/#Text/#PkgId PkgCategorizeR POST DELETE !admin
|
||||
@@ -186,6 +186,7 @@ import Handler.Admin (
|
||||
postPkgUploadR,
|
||||
)
|
||||
import Handler.Eos (getEosR, getEosVersionR)
|
||||
import Handler.Root(getRootR)
|
||||
import Handler.Package
|
||||
import Lib.Ssl (
|
||||
doesSslNeedRenew,
|
||||
@@ -214,7 +215,6 @@ import System.Posix.Process (exitImmediately)
|
||||
import System.Time.Extra (sleep)
|
||||
import Yesod (YesodPersist (runDB))
|
||||
|
||||
|
||||
-- This line actually creates our YesodDispatch instance. It is the second half
|
||||
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the
|
||||
-- comments there for more details.
|
||||
|
||||
@@ -154,7 +154,6 @@ import Database.Persist ((==.))
|
||||
import Database.Persist (selectFirst)
|
||||
import Database.Persist (entityVal)
|
||||
|
||||
|
||||
-- | The foundation datatype for your application. This can be a good place to
|
||||
-- keep settings and values requiring initialization before your application
|
||||
-- starts running, such as database connections. Every handler will have
|
||||
|
||||
11
src/Handler/Root.hs
Normal file
11
src/Handler/Root.hs
Normal file
@@ -0,0 +1,11 @@
|
||||
module Handler.Root where
|
||||
import Startlude
|
||||
import Yesod
|
||||
import Foundation
|
||||
import qualified Data.Text as T
|
||||
import Settings (AppSettings(registryHostname, marketplaceName))
|
||||
|
||||
getRootR :: HandlerFor RegistryCtx ()
|
||||
getRootR = do
|
||||
(url, name) <- getsYesod $ (registryHostname &&& marketplaceName) . appSettings
|
||||
redirect $ T.pack "https://marketplace.start9.com?api=" <> url <> T.pack "&name=" <> name
|
||||
Reference in New Issue
Block a user