on 77167fc help sign in
LICENSEmode 100755 → 100644
since splitsnapshots
unifiedsplit

Only the mode changed.

Procfilemode 100755 → 100644

Only the mode changed.

Setup.hsmode 100755 → 100644

Only the mode changed.

app.jsonmode 100755 → 100644

Only the mode changed.

app/Main.hsmode 100755 → 100644+1−2
@@ -4,7 +4,6 @@ import Network.Wai.Handler.Warp (run)
4import Servant.Server (serve)
4import Servant.Server (serve)
5import System.Environment
5import System.Environment
6import Lib
6import Lib
7−import Network.Wai.Middleware.Cors
8
7
9main :: IO ()
8main :: IO ()
10main = do
9main = do
@@ -13,4 +12,4 @@ main = do
13 putStrLn $ "Starting on port: " ++ show port
12 putStrLn $ "Starting on port: " ++ show port
14 print env
13 print env
15 srv <- createServer
14 srv <- createServer
16− run port $ simpleCors $ serve server srv
15+ run port $ serve server srv
docs.mdmode 100755 → 100644

Only the mode changed.

docs/Docs.hsmode 100755 → 100644

Only the mode changed.

package.yamlmode 100755 → 100644−1
@@ -36,7 +36,6 @@ dependencies:
36- servant-websockets
36- servant-websockets
37- websockets
37- websockets
38- lens
38- lens
39−- wai-cors
40
39
41library:
40library:
42 source-dirs: src
41 source-dirs: src
readme.mdmode 100755 → 100644+2−4
@@ -20,7 +20,7 @@ _url: [`https://websuck1t.herokuapp.com`](https://websuck1t.herokuapp.com)_
20```javascript
20```javascript
21{
21{
22 "token": 1,
22 "token": 1,
23− "response": [
23+ "reponse": [
24 {
24 {
25 "postBody": "This is the post body",
25 "postBody": "This is the post body",
26 "postAuthor": 4,
26 "postAuthor": 4,
@@ -124,8 +124,6 @@ Retrieves a user with the given `id`.
124
124
125## WebSocket /posts/subscribe/:token
125## WebSocket /posts/subscribe/:token
126
126
127−You access the web socket with the web socket protocol. I. e. `https://` -> `ws://`.
128−
129Open a web socket from the given `token` for receiving events about new and deleted posts.
127Open a web socket from the given `token` for receiving events about new and deleted posts.
130
128
131#### Returns error `498` if the supplied token has expired or is invalid.
129#### Returns error `498` if the supplied token has expired or is invalid.
@@ -140,7 +138,7 @@ Open a web socket from the given `token` for receiving events about new and dele
140```javascript
138```javascript
141{
139{
142 "token": 1828,
140 "token": 1828,
143− "response": {
141+ "reponse": {
144 "deleted": [
142 "deleted": [
145 1819,
143 1819,
146 1835,
144 1835,
src/Data/CyclicBuffer.hsmode 100755 → 100644

Only the mode changed.

src/Data/Error.hsmode 100755 → 100644

Only the mode changed.

src/Foo/Data.hsmode 100755 → 100644+3−3
@@ -85,14 +85,14 @@ createConfig :: IO Config
85createConfig = do
85createConfig = do
86 mng <- newManager tlsManagerSettings
86 mng <- newManager tlsManagerSettings
87 cfg <- atomically $ Config <$> newTVar 0 <*> newTVar 0 <*> newTVar M.empty <*> newTVar M.empty <*> return mng <*> newTVar M.empty <*> newTVar 0 <*> newTVar (CB.empty 20)
87 cfg <- atomically $ Config <$> newTVar 0 <*> newTVar 0 <*> newTVar M.empty <*> newTVar M.empty <*> return mng <*> newTVar M.empty <*> newTVar 0 <*> newTVar (CB.empty 20)
88− forkIO . forever $ threadDelay 2000000 >> (runHandler . createApp cfg $ startAddingPosts 20 cfg >>= uncurry sendUpdate)
88+ forkIO . forever $ threadDelay 7000000 >> (runHandler . createApp cfg $ startAddingPosts 20 cfg >>= uncurry sendUpdate)
89 return cfg
89 return cfg
90
90
91type Token = Int
91type Token = Int
92
92
93data TokenizedResponse d = TokenizedResponse {
93data TokenizedResponse d = TokenizedResponse {
94 token :: Token,
94 token :: Token,
95− response :: d
95+ reponse :: d
96} deriving Generic
96} deriving Generic
97
97
98instance ToJSON d => ToJSON (TokenizedResponse d)
98instance ToJSON d => ToJSON (TokenizedResponse d)
@@ -165,7 +165,7 @@ startAddingPosts lim cfg = do
165 let us = users cfg
165 let us = users cfg
166 let ps = posts cfg
166 let ps = posts cfg
167
167
168− a <- liftIO $ loremBacon (manager cfg) (Just AllMeat) (Just lim) (Just 0)
168+ a <- liftIO $ loremBacon (manager cfg) (Just AllMeat) (Just lim) (Just False)
169 g <- liftIO newStdGen
169 g <- liftIO newStdGen
170 let rns = randoms g
170 let rns = randoms g
171
171
src/Lib.hsmode 100755 → 100644

Only the mode changed.

src/Network/Bacon.hsmode 100755 → 100644+3−3
@@ -21,15 +21,15 @@ instance ToHttpApiData LoremType where
21 toQueryParam MeatAndFiller = "meat-and-filler"
21 toQueryParam MeatAndFiller = "meat-and-filler"
22 toQueryParam AllMeat = "all-meat"
22 toQueryParam AllMeat = "all-meat"
23
23
24−type API = QueryParam "type" LoremType :> QueryParam "paras" Int :> QueryParam "start-with-lorem" Int :> Get '[JSON] [Text]
24+type API = QueryParam "type" LoremType :> QueryParam "paras" Int :> QueryParam "start-with-lorem" Bool :> Get '[JSON] [Text]
25
25
26clientAPI :: Proxy API
26clientAPI :: Proxy API
27clientAPI = Proxy
27clientAPI = Proxy
28
28
29−loremBacon' :: Maybe LoremType -> Maybe Int -> Maybe Int -> ClientM [Text]
29+loremBacon' :: Maybe LoremType -> Maybe Int -> Maybe Bool -> ClientM [Text]
30loremBacon' = client clientAPI
30loremBacon' = client clientAPI
31
31
32−loremBacon :: Manager -> Maybe LoremType -> Maybe Int -> Maybe Int -> IO (Maybe [Text])
32+loremBacon :: Manager -> Maybe LoremType -> Maybe Int -> Maybe Bool -> IO (Maybe [Text])
33loremBacon mng a b c = do
33loremBacon mng a b c = do
34 let env = mkClientEnv mng (BaseUrl Https "baconipsum.com" 443 "api")
34 let env = mkClientEnv mng (BaseUrl Https "baconipsum.com" 443 "api")
35 res <- runClientM (loremBacon' a b c) env
35 res <- runClientM (loremBacon' a b c) env
stack.yamlmode 100755 → 100644

Only the mode changed.

swagger/Swagger.hsmode 100755 → 100644

Only the mode changed.

test/Spec.hsmode 100755 → 100644

Only the mode changed.