{"id":16661000,"url":"https://github.com/agrafix/spock-rest","last_synced_at":"2025-10-15T11:46:33.268Z","repository":{"id":66320109,"uuid":"45078322","full_name":"agrafix/Spock-rest","owner":"agrafix","description":"DSL for defining RESTful services in Spock (WIP)","archived":false,"fork":false,"pushed_at":"2015-11-08T23:16:10.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-11T10:43:49.864Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agrafix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-28T00:21:50.000Z","updated_at":"2020-01-20T02:11:00.000Z","dependencies_parsed_at":"2023-03-13T20:29:58.553Z","dependency_job_id":null,"html_url":"https://github.com/agrafix/Spock-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/agrafix/Spock-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2FSpock-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2FSpock-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2FSpock-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2FSpock-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrafix","download_url":"https://codeload.github.com/agrafix/Spock-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrafix%2FSpock-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279077004,"owners_count":26098233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T10:32:57.580Z","updated_at":"2025-10-15T11:46:33.254Z","avatar_url":"https://github.com/agrafix.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Spock-rest\n=====\n\n[![Build Status](https://travis-ci.org/agrafix/Spock-rest.svg)](https://travis-ci.org/agrafix/Spock-rest)\n\n\n## Intro\n\n\nDSL for defining RESTful services in Spock (WIP)\n\n\n## Library Usage Example\n\n```haskell\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\n{-# LANGUAGE MultiParamTypeClasses      #-}\n{-# LANGUAGE OverloadedStrings          #-}\nmodule Main where\n\nimport           Data.Aeson\nimport           Data.HVect\nimport           Web.Spock.Rest\n\nnewtype Req = Req Bool\n    deriving (FromJSON)\nnewtype Resp = Resp Bool\n    deriving (ToJSON)\n\ndata SampleContentType = SampleContentType\n\ninstance ContentType SampleContentType where\n    ctMimeType _ = \"foo/bar\"\n\ninstance ContentReader Req SampleContentType where\n    crDecode _ bs =\n        if bs == \"42\"\n        then Right (Req True)\n        else Left \"Request has to be 42\"\n\nhandleReq :: Req -\u003e Int -\u003e ActionCtxT ctx IO Resp\nhandleReq (Req i) val =\n    return $ Resp $ if i then val \u003e 0 else val \u003c 0\n\nmain :: IO ()\nmain =\n    runSpock 3000 $ spockT id $\n    do post (SampleContentType :~\u003e JSON :|: JSON :~\u003e JSON :|: CtNull) (\"foo\" \u003c//\u003e var) handleReq\n       get (Only JSON :|: CtNull) \"load\" $ \\() -\u003e return $ Resp True\n\n```\n\n## Install\n\n* From Source (cabal): `git clone https://github.com/agrafix/Spock-rest.git \u0026\u0026 cd Spock-rest \u0026\u0026 cabal install`\n* From Source (stack): `git clone https://github.com/agrafix/Spock-rest.git \u0026\u0026 cd Spock-rest \u0026\u0026 stack build`\n\n\n## Misc\n\n### Supported GHC Versions\n\n* 7.10.2\n\n### License\n\nReleased under the MIT license.\n2015 Alexander Thiemann \u003cmail@athiemann.net\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrafix%2Fspock-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrafix%2Fspock-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrafix%2Fspock-rest/lists"}