Skip to content

Instantly share code, notes, and snippets.

@AyaMorisawa
Created December 27, 2015 17:23
Show Gist options
  • Save AyaMorisawa/14daab8c82e981ca6062 to your computer and use it in GitHub Desktop.
Save AyaMorisawa/14daab8c82e981ca6062 to your computer and use it in GitHub Desktop.
{-# 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