Created
December 27, 2015 17:23
-
-
Save AyaMorisawa/14daab8c82e981ca6062 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
module Main where | |
import Web.Scotty | |
import Data.Aeson.TH | |
data Person = Person { name :: String, country :: String } | |
$(deriveJSON defaultOptions ''Person) | |
main :: IO () | |
main = scotty 8080 $ do | |
get "/" $ do | |
json Person { name = "syuilo", country = "Japan" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment