romanb / wai-route Goto Github PK
View Code? Open in Web Editor NEWSimple routing for WAI applications
License: Mozilla Public License 2.0
Simple routing for WAI applications
License: Mozilla Public License 2.0
My understanding is that MPL-2.0
would be the correct choice.
Hello, I'm new on Haskell and I'm trying to route a simple Rest example.
Could you provide me an example of how distinguish the HTTP verbs in the routes?
BTW my actual code
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.HTTP.Types
import Network.Wai
import Network.Wai.Handler.Warp (run)
app :: Application
app req respond = do
putStrLn "I've done some IO here"
respond $ responseLBS
status200
[("Content-Type", "text/plain")]
"Hello, Web!"
main :: IO ()
main = do
putStrLn "http://localhost:8080/"
run 8080 app
The following output, followed by the contents of a large bytestring:
> /tmp/stackage-build13/wai-route-0.3.1.1$ dist/build/wai-route-test/wai-route-test
Tests
Routing: FAIL (0.15s)
*** Failed! (after 78 tests):
Exception:
Data.ByteString.head: empty ByteString
CallStack (from HasCallStack):
error, called at libraries/bytestring/Data/ByteString.hs:1877:23 in bytestring-0.10.8.2:Data.ByteString
Is it necessary to pin base == 4.6.*
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.