Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scotty-specific middlewares #130

Closed
wants to merge 218 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
3f9cc73
Merge pull request #6 from myfreeweb/master
Apr 12, 2012
95f3e6b
Bump version. Bump conduit version and put upper bound on it.
Apr 12, 2012
f5a99eb
Merge pull request #5 from sordina/master
Apr 12, 2012
1f6cf6e
Fix static file middleware to allow ..'s in argument, but not request…
Apr 16, 2012
fd59918
Lets get organized... charging towards a release.
Apr 16, 2012
42413cc
More cleanup.
Apr 16, 2012
a21f553
Comment Wibble. 0.4 Release.
Apr 16, 2012
1918cea
Use pathInfo instead of rawPathInfo, to support being a subsite.
Apr 20, 2012
3e7d64a
Reorder imports.
Apr 20, 2012
799a1b6
Move mkEnv
May 4, 2012
0be8f67
Add ability to get params as function arguments to the action.
May 7, 2012
a10e987
Fix mappend synonym issue.
May 8, 2012
5983e1a
Version bump.
May 8, 2012
9187027
basic.hs needs wai-extra for Network.Wai.Middleware.RequestLogger
May 22, 2012
9549344
added missing argument to get "/lambda"
May 22, 2012
f2e9244
Add "source" function to construct response directly from a Source
BardurArantsson May 25, 2012
1657e6f
Merge pull request #13 from BardurArantsson/add-source-response
May 26, 2012
8743afb
Merge pull request #12 from shapr/master
May 26, 2012
571e389
Merge pull request #2 from clockfort/master
Jun 6, 2012
da36d25
Add Options, use it to contain Warp Settings, and other flags.
Jun 6, 2012
3c55a55
Add example of using Options
Jun 6, 2012
6142777
Version bump
Jun 6, 2012
175d1ee
Fix wai-middleware-static to use pathInfo instead of rawPathInfo
Jun 6, 2012
a46b9c2
wai-middleware-static: Add staticList and version bump.
Jun 6, 2012
60f1268
wai-middleware-static: forgot existence check
Jun 6, 2012
165e67a
wai-middleware-static: Switch to policy-based approach
Jun 7, 2012
9a63208
Update json example to new static middleware
Jun 7, 2012
fe0fa27
wai-middleware-static: fix broken static
Jun 7, 2012
8e3097b
Add Policy choice operator.
Jun 8, 2012
f94967b
Make Policy abstract
Jun 8, 2012
66fc313
Expose Parsable and readEither, and improve haddock.
Jun 25, 2012
7bb0ecf
confirmed that scotty works with new wai/conduit
konn Jul 15, 2012
75e96f7
Fix for #19: Get all request parameters.
dpwiz Jul 17, 2012
c38a748
Merge pull request #17 from konn/master
Jul 17, 2012
1939f68
Merge pull request #20 from wiz/master
Jul 17, 2012
346309b
Fix use of deprecated Ascii type synonym.
Jul 18, 2012
1b9a510
Extraneous return, and params not exported from top level.
Jul 18, 2012
fe7a436
Organize haddock a bit.
Jul 18, 2012
bc51c4c
Add reqHeader
Jul 18, 2012
fbc108d
Fix form encoding matcher to use isPrefixOf
Jul 21, 2012
c7542df
added support for file upload
jhnewman Jul 23, 2012
3589836
Merge branch 'topic/file' of https://github.com/smadge/scotty
Jul 24, 2012
891915c
Some mkEnv cleanup.
Jul 24, 2012
1ca880e
Version bump.
Jul 24, 2012
936268c
Add upload example, and clean up files interface a bit.
Jul 25, 2012
777de67
Loosen upper bound of http-types
Aug 26, 2012
48a3adf
Merge pull request #24 from fujimura/loosen_upper_bound_of_http_types
Aug 30, 2012
2af0c94
Fix deprecated type synonym.
Aug 30, 2012
b775387
Version bump
Aug 30, 2012
0cf6746
fixed deprecataed references, in examples
dmjio Oct 16, 2012
5c26d5c
Merge pull request #31 from djohnsonm/master
Oct 25, 2012
b1b22dc
Probable fix to the conduit issue.
Oct 1, 2012
9cfadcd
Add note about extra packages for urlshortener example.
Oct 25, 2012
a2d7b4c
Change official repo, update dep versions, version bump, remove text …
Oct 25, 2012
35a1473
Allow user to set the response body to a given raw data
Dec 28, 2012
0f87278
Fix wai-middleware-static package bounds.
Feb 11, 2013
d6bda34
GZip example
Jun 2, 2013
c7a3c5e
Merge branch 'master' of https://github.com/xich/scotty
Jun 2, 2013
114615c
Add ScottyT and ActionT transformers.
Aug 22, 2013
f140b23
Use transResourceT instead of hoist, make scottyApp sig more specific.
Aug 25, 2013
e617c0b
Version bump
Aug 25, 2013
eb50876
Add support for HTTP PATCH
Aug 26, 2013
bd39846
Update README
Aug 27, 2013
e4ed112
Remove no-longer-existing lambda-action example.
Aug 27, 2013
2ec4b6e
Add Web.Scotty.Trans module, redefining Web.Scotty in terms of it.
Aug 27, 2013
cffeed2
Add example of using ScottyT to embed custom state monad.
Aug 27, 2013
5ab174d
Change reqHeader to return Maybe Text
Aug 27, 2013
5c21000
Merge pull request #33 from co-dan/master
Aug 27, 2013
6a04328
Merge branch 'master' of github.com:xich/scotty
Aug 27, 2013
c5d68a4
Bring the 'raw' patch up to date with new transformers.
Aug 27, 2013
a8bc5ad
Accept traditional middleware, instead of Scotty's internal middlewar…
Aug 29, 2013
2b8a2ed
Use the ReaderT/TVar solution for globalstate example rather than Sta…
Sep 2, 2013
a02a1fa
Add body to the error message when jsonData can't parse.
Sep 13, 2013
f88ca8e
Split 'header' into 'setHeader' and 'addHeader'
Sep 13, 2013
a108569
Remove clicker example
Sep 13, 2013
de06b8f
Update gzip example
Sep 13, 2013
d6f261d
Markdown readme
Sep 18, 2013
2dfcf2e
Start tracking release notes.
Sep 18, 2013
a4352d5
Fix code block in ReleaseNotes.md
Sep 18, 2013
dd3a8a7
Update cabal file with extra-source-files
Sep 18, 2013
076b3f6
Update copyright date in cabal file
Sep 18, 2013
0113c73
Add paren
Sep 20, 2013
60f3963
Added Parsable instance for strict Text.
abhinav Oct 5, 2013
e5291b3
Added Applicative instances for ScottyT and ActionT.
abhinav Oct 5, 2013
2ea5ac4
Merge pull request #50 from abhinav/parsable-text
Oct 5, 2013
8ba28e1
Merge pull request #49 from abhinav/applicative
Oct 5, 2013
7d1375b
Only define ActionM and ScottyM in specialized module.
Oct 17, 2013
f09fd12
Add Helpers module
Oct 17, 2013
e891ca9
Unbreak the build. :-P
Oct 17, 2013
f38b9cc
Add example of custom exceptions.
Oct 28, 2013
3f58c59
Add examples/exceptions.hs to cabal file
Oct 28, 2013
cbda1e6
Some misc cleanup
Dec 4, 2013
05b3772
Overhaul for Wai 2.0, take away access to monad internals, beginning …
Dec 5, 2013
728422d
Fix wai-middleware-static for Wai 2.0
Dec 5, 2013
ec082d1
Add .keep file to examples/uploads directory for upload example.
Dec 5, 2013
dc98c2f
Allow for custom exception types, rather than just Text
Dec 5, 2013
95fb986
Edit repo URLs
Dec 6, 2013
5d7d928
Cleanup of examples, and new cookie example.
Dec 6, 2013
f7b2fa5
Update haddock
Dec 6, 2013
51dc83d
Remove Web.Scotty.Helpers (to reappear in scotty-extra)
Dec 6, 2013
b5bb6e8
Update release notes.
Dec 6, 2013
2350eea
Ack forgot to adjust URLs in wai-middleware-static
Dec 6, 2013
848cdfb
Match changes in wai-extra 2.0.1
Dec 13, 2013
6e2c690
Time to upgrade (or loosen?) text dependency
qrilka Dec 21, 2013
932ce11
Merge pull request #62 from qrilka/patch-1
Dec 22, 2013
27dda76
Keep lower bound on text, bump version
Dec 22, 2013
8e917be
Bump text bounds for wai-middleware-static
Dec 22, 2013
2a8c36f
Bump text and aeson upper bounds
bgamari Jan 23, 2014
225c642
Merge pull request #68 from bgamari/version-bumps
Jan 27, 2014
1744c7c
Allow case-insensitive parsing of True/False (javascript uses true/fa…
Jan 27, 2014
cb2187b
Bump version, add release notes
Jan 27, 2014
449d188
text version bump.
sebastian-philipp Feb 10, 2014
8596f58
Merge pull request #71 from sebastian-philipp/master
Feb 18, 2014
39fa6e1
Bump warp/wai/wai-extra bounds, including minbound for warp slowloris…
Mar 10, 2014
e337962
Rename ReleaseNotes.md to changelog.md so hackage picks it up
Mar 10, 2014
9bc1715
Use setPort instead of settingsPort as a setter
Mar 10, 2014
bd7eea4
Lift IO exceptions into ActionT exceptions via stringError
Mar 10, 2014
b844137
Fixing imports
Fristi Mar 11, 2014
4094455
setPort is introduced in warp-2.1.0, so 2.0.3.3 is not enough
echaozh Mar 14, 2014
c86695f
settingsPort is deprecated, use getPort from warp-2.1.1
echaozh Mar 14, 2014
b1a9424
Merge pull request #78 from echaozh/warp-version
Mar 17, 2014
fabe537
Merge branch 'master' of github.com:Fristi/scotty into Fristi-master
Mar 17, 2014
d2114bc
Renamed 'reqHeader' to 'header', add 'headers', deprecation notice.
Mar 17, 2014
8497a34
Add to changelog
Mar 17, 2014
5994dd2
Bump wai upper bound to sync with scotty
Mar 19, 2014
49c6577
Use setFdCacheDuration 0 to work around #55
Mar 19, 2014
b63e76e
Update haddock docs, including notes about production servers.
Mar 19, 2014
c8ea6c4
Bump version and changelog
Mar 19, 2014
2745727
Use secure defaults for static middleware.
nhibberd Mar 24, 2014
256c9fe
Merge pull request #81 from nhibberd/master
Mar 24, 2014
e757d0f
Remove redundant policies, add haddock docs
Mar 24, 2014
c5d921a
Bump version, add changelog
Mar 24, 2014
0cad947
Update copyright year in cabal file
Mar 24, 2014
abefd01
Bump bounds on conduit, add conduit-extra
Apr 8, 2014
893dfa4
Edit changelog
Apr 8, 2014
e58a6ba
Allow case-insensitive 1.2.*
sol Apr 9, 2014
71519bd
DRY up capture
sol Apr 9, 2014
102a7d6
Merge pull request #83 from sol/dry-up
Apr 9, 2014
088605a
Add travis-ci config
sol Apr 10, 2014
ef11474
Merge pull request #84 from sol/master
Apr 10, 2014
8005632
Indent body of 'do' in README example.
robx Apr 12, 2014
571350e
Ignore sandbox files
fujimura Apr 12, 2014
8e2928b
Merge pull request #86 from fujimura/ignore-cabal-sandbox-files
Apr 14, 2014
5fd51db
Merge pull request #85 from robx/master
Apr 14, 2014
ff3a521
2 spaces to 4
Apr 14, 2014
e10ca24
scotty.cabal: allow mtl-2.2, transformers-0.4
May 24, 2014
e8fdaad
Merge pull request #94 from trofi/master
May 27, 2014
ccb09e3
Bump version
sol May 28, 2014
01bc32c
Setup Hspec
fujimura Apr 12, 2014
e7f80cc
Add coveralls setting to travis.yml
fujimura Apr 12, 2014
496974b
Add specs for some basic scotty functions
fujimura Apr 12, 2014
2b9a217
Add travis.ci and coveralls badge to readme
fujimura Apr 12, 2014
b37c5e6
Remove TODO and pending spec
fujimura May 29, 2014
e1c4465
Clean up test dependencies
sol May 29, 2014
275cfe2
wai-middleware-static: Allow mtl-0.2.*
sol May 30, 2014
f211b8e
wai-middleware-static: Bump version
sol May 30, 2014
2ed02fa
Exclude test directory for coveralls
sol May 30, 2014
a8dbce6
Show coverall stats for master
sol May 30, 2014
aedefd5
added default-language under test-suite spec
May 30, 2014
93c48af
Merge pull request #96 from rdesfo/master
May 30, 2014
d0eed6d
Update to wai/wai-extra/warp 3.0
Jun 9, 2014
458d54e
source in terms of stream
alexbiehl Jun 10, 2014
a79c982
Merge pull request #98 from alexbiehl/master
Jun 10, 2014
e4ec454
Update changelog
Jun 10, 2014
a435446
Remove deprecated reqHeader
Jun 10, 2014
26f9013
Fix deprecation pragmas/comments. Order imports.
Jun 10, 2014
57db0b0
Remove trailing whitespace
sol Jun 10, 2014
6a32f7b
Add IRC channel
sol Jun 10, 2014
9403b0e
Merge pull request #100 from scotty-web/irc
sol Jun 10, 2014
c2e9ede
Change IRC channel to #scotty
Jun 10, 2014
1186eaa
added MonadBase MonadTransControl and MonadBaseControl instances
sebastian-philipp Mar 24, 2014
5d11dc8
added test case for MonadBaseControl instance
sebastian-philipp Jun 10, 2014
06eb001
Export internal types
sol Jun 17, 2014
cfaf144
Merge pull request #101 from scotty-web/export-internals
Jun 17, 2014
62c0fb5
Merge branch 'pr/82'
sol Jun 18, 2014
677b7b6
Remove trailing whitespace
sol Jun 19, 2014
0499927
Bump version and update changelog
sol Jun 19, 2014
a513c24
Use Control.Monad.Except if mtl >= 2.2.1
Jul 16, 2014
50371e9
Improved indentation
Jul 16, 2014
26bf168
Merge pull request #102 from RyanGlScott/master
Jul 16, 2014
c923697
Add link to wiki in README.md
Jul 17, 2014
b215712
Relax aeson upper bound
tekul Jul 19, 2014
04bf942
Bump version and update changelog
sol Jul 20, 2014
c38d830
Set charset=utf-8 in Content-Type when serving UTF-8 plaintext and HTML
jameshfisher Aug 11, 2014
ab04289
Merge pull request #106 from jameshfisher/fix/content-type-charset-utf-8
Aug 11, 2014
21e5580
Remove wai-middleware-static (in its own repo now)
Aug 13, 2014
3e15ac6
cabal repl
Aug 13, 2014
7e43ba0
Use hspec-wai for specs + nicer spec descriptions
sol Aug 13, 2014
a6fe92e
Assume HTTP status 500 for `defaultHandler`
sol Aug 14, 2014
faa9b2d
Merge pull request #111 from scotty-web/improved-error-handling
Aug 14, 2014
04a22a0
set default json charset to utf-8 to avoid international chars becomi…
wfaler Aug 25, 2014
6dcb7ba
Merge pull request #113 from wfaler/master
Aug 25, 2014
5e3997a
Update haddock for html/text/json to match code.
Aug 25, 2014
7701572
Update changelog and bump version
sol Aug 26, 2014
a88e4ec
Merge pull request #114 from scotty-web/cut-a-release
Aug 27, 2014
9ee9d33
Remove deprecated source functions and conduit dep
Aug 27, 2014
c8e48fa
ScottyError constraint necessary for mtl < 2.2.1
Aug 27, 2014
889f9aa
Parens
Aug 27, 2014
5299c33
Update changelog
Aug 27, 2014
e778148
Make text/html/json only set Content-Type if not already set.
Sep 1, 2014
003577e
Update changelog
Sep 1, 2014
a408460
Adapt for hspec-wai-0.4.*
sol Sep 8, 2014
c4ef248
Bump text upper version bounds
Sep 9, 2014
8338eb1
Fix travis build
sol Sep 9, 2014
6247ec1
Merge pull request #119 from RyanGlScott/master
sol Sep 9, 2014
005c619
Require hspec-wai >= 0.4.1
sol Sep 9, 2014
9c5dc87
Remove the use of the LambdaCase extension
ppetr Sep 5, 2014
3bd7a09
Update for hspec-wai 0.5.*
sol Sep 24, 2014
576c5b6
Create an example of using the reader monad
tfausak Oct 3, 2014
b4882b9
Rename "state" to "config"
tfausak Oct 6, 2014
26285cc
Derive functor and applicative instances too
tfausak Oct 6, 2014
f48fcc7
Add a motivating comment
tfausak Oct 6, 2014
31e6644
Use aeson's eitherDecode instead of just decode
k-bx Oct 29, 2014
b7f9972
Merge pull request #125 from k-bx/either-decode
Oct 29, 2014
787580a
Add more tests
sol Nov 2, 2014
1b6eb89
Depend on hspec-2.*
sol Nov 11, 2014
90ff262
Merge pull request #129 from scotty-web/update-hspec
sol Nov 11, 2014
f9bbe0b
Add scotty-specific middlewares
Shimuuar Oct 27, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ dist/
*.hi
*.o
*.swp
cabal-dev/
.cabal-sandbox/
cabal.sandbox.config
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: haskell

install:
- cabal install --only-dependencies --enable-tests
- cabal install hpc-coveralls

script:
- cabal configure --enable-tests --enable-library-coverage --ghc-options=-Werror && cabal build
- run-cabal-test --show-details=always

after_script:
- hpc-coveralls --exclude-dir=test spec
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
boot:
cabal install --force-reinstalls

ghci:
cabal repl
107 changes: 0 additions & 107 deletions Network/Wai/Middleware/Static.hs

This file was deleted.

38 changes: 0 additions & 38 deletions README

This file was deleted.

44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Scotty [![Build Status](https://travis-ci.org/scotty-web/scotty.svg)](https://travis-ci.org/scotty-web/scotty)[![Coverage Status](https://coveralls.io/repos/scotty-web/scotty/badge.png?branch=master)](https://coveralls.io/r/scotty-web/scotty?branch=master)

A Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp.

```haskell
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty

import Data.Monoid (mconcat)

main = scotty 3000 $ do
get "/:word" $ do
beam <- param "word"
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]
```

Scotty is the cheap and cheerful way to write RESTful, declarative web applications.

* A page is as simple as defining the verb, url pattern, and Text content.
* It is template-language agnostic. Anything that returns a Text value will do.
* Conforms to WAI Application interface.
* Uses very fast Warp webserver by default.

See examples/basic.hs to see Scotty in action. (basic.hs needs the wai-extra package)

```bash
> runghc examples/basic.hs
Setting phasers to stun... (port 3000) (ctrl-c to quit)
(visit localhost:3000/somepath)
```

As for the name: Sinatra + Warp = Scotty.

### More Information

Tutorials and related projects can be found in the Scotty wiki:

https://github.com/scotty-web/scotty/wiki

### Development & Support

Open an issue on GitHub or join `#scotty` on Freenode.

Copyright (c) 2012-2014 Andrew Farmer
Loading