mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 11:51:57 +00:00
rename endpoints
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
!/package/#S9PK AppR GET -- get most recent appId at appversion spec, defaults to >=0.0.0 -- ?spec={semver-spec}
|
!/package/#S9PK AppR GET -- get most recent appId at appversion spec, defaults to >=0.0.0 -- ?spec={semver-spec}
|
||||||
/data CategoriesR GET -- get all marketplace categories
|
/marketplace/package/data CategoriesR GET -- get all marketplace categories
|
||||||
/packages PackageListR GET -- filter marketplace services by various query params
|
/marketplace/package/index PackageListR GET -- filter marketplace services by various query params
|
||||||
/eos EosR GET -- get eos information
|
/eos EosR GET -- get eos information
|
||||||
/version/latest VersionLatestR GET -- get latest version of apps in query param id
|
/marketplace/latest-version VersionLatestR GET -- get latest version of apps in query param id
|
||||||
/package/manifest/#AppIdentifier AppManifestR GET -- get app manifest from appmgr -- ?version={semver-spec}
|
/package/manifest/#AppIdentifier AppManifestR GET -- get app manifest from appmgr -- ?version={semver-spec}
|
||||||
|
/marketplace/package/release-notes getReleaseNotesR GET -- get release notes for package - expects query param of id=<pacakge-id>
|
||||||
|
|
||||||
-- TODO deprecate
|
-- TODO deprecate
|
||||||
!/sys/#SYS_EXTENSIONLESS SysR GET -- get most recent sys app -- ?spec={semver-spec}
|
!/sys/#SYS_EXTENSIONLESS SysR GET -- get most recent sys app -- ?spec={semver-spec}
|
||||||
|
|||||||
@@ -19,6 +19,19 @@ import System.FilePath ((</>))
|
|||||||
getIconsR :: Extension "png" -> Handler TypedContent
|
getIconsR :: Extension "png" -> Handler TypedContent
|
||||||
getIconsR ext = do
|
getIconsR ext = do
|
||||||
-- @TODO switch to getting from service directory
|
-- @TODO switch to getting from service directory
|
||||||
|
AppSettings{..} <- appSettings <$> getYesod
|
||||||
|
mPng <- liftIO $ getVersionedFileFromDir (resourcesDir </> "icons") ext
|
||||||
|
case mPng of
|
||||||
|
Nothing -> notFound
|
||||||
|
Just pngPath -> do
|
||||||
|
putStrLn @Text $ show pngPath
|
||||||
|
exists <- liftIO $ doesFileExist pngPath
|
||||||
|
if exists
|
||||||
|
then respondSource typePlain $ CB.sourceFile pngPath .| awaitForever sendChunkBS
|
||||||
|
else notFound
|
||||||
|
|
||||||
|
getLicenseR :: Extension "" -> Handler TypedContent
|
||||||
|
getLicenseR ext = do
|
||||||
AppSettings{..} <- appSettings <$> getYesod
|
AppSettings{..} <- appSettings <$> getYesod
|
||||||
mPng <- liftIO $ getUnversionedFileFromDir (resourcesDir </> "icons") ext
|
mPng <- liftIO $ getUnversionedFileFromDir (resourcesDir </> "icons") ext
|
||||||
case mPng of
|
case mPng of
|
||||||
@@ -29,3 +42,17 @@ getIconsR ext = do
|
|||||||
if exists
|
if exists
|
||||||
then respondSource typePlain $ CB.sourceFile pngPath .| awaitForever sendChunkBS
|
then respondSource typePlain $ CB.sourceFile pngPath .| awaitForever sendChunkBS
|
||||||
else notFound
|
else notFound
|
||||||
|
|
||||||
|
getMarkdownR :: Extension "md" -> Handler TypedContent
|
||||||
|
getMarkdownR ext = do
|
||||||
|
-- @TODO switch to getting from service directory
|
||||||
|
AppSettings{..} <- appSettings <$> getYesod
|
||||||
|
mPng <- liftIO $ getUnversionedFileFromDir (resourcesDir </> "icons") ext
|
||||||
|
case mPng of
|
||||||
|
Nothing -> notFound
|
||||||
|
Just pngPath -> do
|
||||||
|
putStrLn @Text $ show pngPath
|
||||||
|
exists <- liftIO $ doesFileExist pngPath
|
||||||
|
if exists
|
||||||
|
then respondSource typePlain $ CB.sourceFile pngPath .| awaitForever sendChunkBS
|
||||||
|
else notFound
|
||||||
Reference in New Issue
Block a user