Skip to content

Commit

Permalink
Add root path to API.
Browse files Browse the repository at this point in the history
  • Loading branch information
xnomagichash authored and katzj committed Jul 25, 2018
1 parent f951d77 commit dc712b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/API.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE OverloadedStrings #-}

module API
( API
, server
) where

import Data.Text (Text)
import Dependencies
import Dependency
import Distribution.Types.GenericPackageDescription (GenericPackageDescription)
import Distribution.Types.GenericPackageDescription.MimeUnrender ()
import Servant ((:>), JSON, PlainText, Post, ReqBody, Server)
import Servant

type API = "parse" :> ReqBody '[PlainText] GenericPackageDescription :> Post '[JSON] [Dependency]
:<|> Get '[PlainText] Text

server :: Server API
server = return . dependencies
server = (return . dependencies) :<|> return ""

0 comments on commit dc712b1

Please sign in to comment.