|
1 | 1 | cabal-version: 1.12 |
2 | 2 |
|
3 | | --- This file has been generated from package.yaml by hpack version 0.35.2. |
| 3 | +-- This file has been generated from package.yaml by hpack version 0.39.1. |
4 | 4 | -- |
5 | 5 | -- see: https://github.com/sol/hpack |
6 | 6 |
|
7 | | -name: mig-server |
8 | | -version: 0.2.1.0 |
9 | | -synopsis: Build lightweight and composable servers |
10 | | -description: With library mig we can build lightweight and composable servers. |
11 | | - There are only couple of combinators to assemble servers from parts. |
12 | | - It supports generic handler functions as servant does. But strives to use more |
13 | | - simple model for API. It does not go to describing Server API at type level which |
14 | | - leads to simpler error messages. |
15 | | - . |
16 | | - The main features are: |
17 | | - . |
18 | | - * lightweight library |
19 | | - . |
20 | | - * expressive DSL to compose servers |
21 | | - . |
22 | | - * type-safe handlers |
23 | | - . |
24 | | - * handlers are encoded with generic haskell functions |
25 | | - . |
26 | | - * built on top of WAI and warp server libraries. |
27 | | - . |
28 | | - Example of hello world server: |
29 | | - . |
30 | | - > {-# Language OverloadedStrings #-} |
31 | | - > import Mig.Json.IO |
32 | | - > |
33 | | - > -- | We can render the server and run it on port 8085. |
34 | | - > -- It uses wai and warp. |
35 | | - > main :: IO () |
36 | | - > main = runServer 8085 server |
37 | | - > |
38 | | - > -- | Init simple hello world server whith two routes: |
39 | | - > server :: Server IO |
40 | | - > server = |
41 | | - > "api/v1" /. |
42 | | - > [ "hello" /. hello |
43 | | - > , "bye" /. bye |
44 | | - > ] |
45 | | - > |
46 | | - > -- | Handler takes no inputs and marked as Get HTTP-request that returns Text. |
47 | | - > hello :: Get (Resp Text) |
48 | | - > hello = pure $ ok "Hello World" |
49 | | - > |
50 | | - > -- | Handle with URL-param query and json body input as Post HTTP-request that returns Text. |
51 | | - > bye :: Query "name" Text -> Body Text -> Post (Resp Text) |
52 | | - > bye (Query name) (Body greeting) = |
53 | | - > pure $ ok $ "Bye to " <> name <> " " <> greeting |
54 | | - . |
55 | | - Please see: |
56 | | - . |
57 | | - * quick start guide at <https://anton-k.github.io/mig/> |
58 | | - . |
59 | | - * examples directory for more fun servers: at <https://github.com/anton-k/mig/tree/main/examples/mig-example-apps#readme> |
60 | | - . |
61 | | - * reference for the main functions: <https://anton-k.github.io/mig/09-reference.html> |
62 | | -category: Web |
63 | | -homepage: https://github.com/anton-k/mig#readme |
64 | | -bug-reports: https://github.com/anton-k/mig/issues |
65 | | -author: Anton Kholomiov |
66 | | -maintainer: anton.kholomiov@gmail.com |
67 | | -copyright: 2023 Anton Kholomiov |
68 | | -license: BSD3 |
69 | | -license-file: LICENSE |
70 | | -build-type: Simple |
| 7 | +name: mig-server |
| 8 | +version: 0.2.2.0 |
| 9 | +synopsis: Build lightweight and composable servers |
| 10 | +description: With library mig we can build lightweight and composable servers. |
| 11 | + There are only couple of combinators to assemble servers from parts. |
| 12 | + It supports generic handler functions as servant does. But strives to use more |
| 13 | + simple model for API. It does not go to describing Server API at type level which |
| 14 | + leads to simpler error messages. |
| 15 | + . |
| 16 | + The main features are: |
| 17 | + . |
| 18 | + * lightweight library |
| 19 | + . |
| 20 | + * expressive DSL to compose servers |
| 21 | + . |
| 22 | + * type-safe handlers |
| 23 | + . |
| 24 | + * handlers are encoded with generic haskell functions |
| 25 | + . |
| 26 | + * built on top of WAI and warp server libraries. |
| 27 | + . |
| 28 | + Example of hello world server: |
| 29 | + . |
| 30 | + > {-# Language OverloadedStrings #-} |
| 31 | + > import Mig.Json.IO |
| 32 | + > |
| 33 | + > -- | We can render the server and run it on port 8085. |
| 34 | + > -- It uses wai and warp. |
| 35 | + > main :: IO () |
| 36 | + > main = runServer 8085 server |
| 37 | + > |
| 38 | + > -- | Init simple hello world server whith two routes: |
| 39 | + > server :: Server IO |
| 40 | + > server = |
| 41 | + > "api/v1" /. |
| 42 | + > [ "hello" /. hello |
| 43 | + > , "bye" /. bye |
| 44 | + > ] |
| 45 | + > |
| 46 | + > -- | Handler takes no inputs and marked as Get HTTP-request that returns Text. |
| 47 | + > hello :: Get (Resp Text) |
| 48 | + > hello = pure $ ok "Hello World" |
| 49 | + > |
| 50 | + > -- | Handle with URL-param query and json body input as Post HTTP-request that returns Text. |
| 51 | + > bye :: Query "name" Text -> Body Text -> Post (Resp Text) |
| 52 | + > bye (Query name) (Body greeting) = |
| 53 | + > pure $ ok $ "Bye to " <> name <> " " <> greeting |
| 54 | + . |
| 55 | + Please see: |
| 56 | + . |
| 57 | + * quick start guide at <https://anton-k.github.io/mig/> |
| 58 | + . |
| 59 | + * examples directory for more fun servers: at <https://github.com/anton-k/mig/tree/main/examples/mig-example-apps#readme> |
| 60 | + . |
| 61 | + * reference for the main functions: <https://anton-k.github.io/mig/09-reference.html> |
| 62 | +category: Web |
| 63 | +homepage: https://github.com/anton-k/mig#readme |
| 64 | +bug-reports: https://github.com/anton-k/mig/issues |
| 65 | +author: Anton Kholomiov |
| 66 | +maintainer: anton.kholomiov@gmail.com |
| 67 | +copyright: 2023 Anton Kholomiov |
| 68 | +license: BSD3 |
| 69 | +license-file: LICENSE |
| 70 | +build-type: Simple |
71 | 71 | extra-source-files: |
72 | | - README.md |
| 72 | + README.md |
73 | 73 |
|
74 | 74 | source-repository head |
75 | 75 | type: git |
76 | 76 | location: https://github.com/anton-k/mig |
77 | 77 |
|
78 | 78 | library |
79 | 79 | exposed-modules: |
80 | | - Mig |
81 | | - Mig.Html |
82 | | - Mig.Html.IO |
83 | | - Mig.IO |
84 | | - Mig.Json |
85 | | - Mig.Json.IO |
86 | | - Mig.Server.Warp |
| 80 | + Mig |
| 81 | + Mig.Html |
| 82 | + Mig.Html.IO |
| 83 | + Mig.IO |
| 84 | + Mig.Json |
| 85 | + Mig.Json.IO |
| 86 | + Mig.Server.Warp |
87 | 87 | other-modules: |
88 | | - Paths_mig_server |
| 88 | + Paths_mig_server |
89 | 89 | hs-source-dirs: |
90 | | - src |
| 90 | + src |
91 | 91 | default-extensions: |
92 | | - DerivingStrategies |
93 | | - DuplicateRecordFields |
94 | | - LambdaCase |
95 | | - OverloadedRecordDot |
96 | | - OverloadedStrings |
97 | | - StrictData |
98 | | - TypeFamilies |
| 92 | + DerivingStrategies |
| 93 | + DuplicateRecordFields |
| 94 | + LambdaCase |
| 95 | + OverloadedRecordDot |
| 96 | + OverloadedStrings |
| 97 | + StrictData |
| 98 | + TypeFamilies |
99 | 99 | ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wunused-packages |
100 | 100 | build-depends: |
101 | | - aeson |
102 | | - , base >=4.7 && <5 |
103 | | - , blaze-html |
104 | | - , data-default |
105 | | - , http-api-data |
106 | | - , http-types |
107 | | - , mig >=0.2.1.0 |
108 | | - , mig-extra >=0.1.1.0 |
109 | | - , mig-swagger-ui >=0.1 |
110 | | - , mig-wai >=0.1.0.1 |
111 | | - , openapi3 |
112 | | - , text |
113 | | - , transformers |
114 | | - , warp |
| 101 | + aeson, |
| 102 | + base >=4.7 && <5, |
| 103 | + blaze-html, |
| 104 | + data-default, |
| 105 | + http-api-data, |
| 106 | + http-types, |
| 107 | + mig >=0.2.1.0, |
| 108 | + mig-extra >=0.1.1.0, |
| 109 | + mig-swagger-ui >=0.1.1, |
| 110 | + mig-wai >=0.1.0.1, |
| 111 | + openapi3, |
| 112 | + text, |
| 113 | + transformers, |
| 114 | + warp |
115 | 115 | default-language: GHC2021 |
0 commit comments