mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
rename endpoints
This commit is contained in:
committed by
Keagan McClelland
parent
96b194f615
commit
99dba0e273
@@ -1,10 +1,11 @@
|
||||
|
||||
!/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
|
||||
/packages PackageListR GET -- filter marketplace services by various query params
|
||||
/marketplace/package/data CategoriesR GET -- get all marketplace categories
|
||||
/marketplace/package/index PackageListR GET -- filter marketplace services by various query params
|
||||
/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}
|
||||
/marketplace/package/release-notes getReleaseNotesR GET -- get release notes for package - expects query param of id=<pacakge-id>
|
||||
|
||||
-- TODO deprecate
|
||||
!/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 ext = do
|
||||
-- @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
|
||||
mPng <- liftIO $ getUnversionedFileFromDir (resourcesDir </> "icons") ext
|
||||
case mPng of
|
||||
@@ -29,3 +42,17 @@ getIconsR ext = do
|
||||
if exists
|
||||
then respondSource typePlain $ CB.sourceFile pngPath .| awaitForever sendChunkBS
|
||||
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