Disabled /package/ page. See #299

This commit is contained in:
Alexey Kuleshevich 2020-11-11 01:21:59 +03:00
parent 098d5176d7
commit 6389b4468f
No known key found for this signature in database
GPG Key ID: E59B216127119E3E

View File

@ -1,22 +1,26 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Handler.PackageList where
import Import
import Stackage.Database
import Text.Blaze
-- FIXME maybe just redirect to the LTS or nightly package list
getPackageListR :: Handler Html
getPackageListR =
track "Handler.PackageList.getPackageListR" $
defaultLayout $ do
cacheSeconds $ 60 * 60 * 2
setTitle "Package list"
packages <- getAllPackages
$(widgetFile "package-list")
where
strip x = fromMaybe x (stripSuffix "." x)
makePackageLink snapName pli =
SnapshotR snapName $ StackageSdistR $ PNVNameVersion (pliName pli) (pliVersion pli)
getPackageListR = do
sendResponseStatus status404 =<<
defaultLayout
(toWidget (preEscapedText
("Page has been disabled, see: " <>
"<a href=\"https://github.com/fpco/stackage-server/issues/299\">" <>
"github:fpco/stackage-server#299</a>")))
-- track "Handler.PackageList.getPackageListR" $
-- defaultLayout $ do
-- cacheSeconds $ 60 * 60 * 2
-- setTitle "Package list"
-- packages <- getAllPackages
-- $(widgetFile "package-list")
-- where
-- strip x = fromMaybe x (stripSuffix "." x)
-- makePackageLink snapName pli =
-- SnapshotR snapName $ StackageSdistR $ PNVNameVersion (pliName pli) (pliVersion pli)