Coder Social home page Coder Social logo

jfraudeau / scotty Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scotty-web/scotty

0.0 1.0 0.0 514 KB

Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)

Home Page: http://hackage.haskell.org/package/scotty

License: BSD 3-Clause "New" or "Revised" License

Haskell 99.92% Makefile 0.08%

scotty's Introduction

Scotty Build Status

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

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

import Data.Monoid (mconcat)

main = scotty 3000 $
    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 the web application interface (WAI).
  • Uses the very fast Warp webserver by default.

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

> 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.

Development & Support

Open an issue on GitHub.

Copyright (c) 2012-2019 Andrew Farmer

FAQ

  • Fails to compile regex-posix on Windows
    • If you are using stack, add the following parameters to stack.yaml:
      •   extra-deps:
          - regex-posix-clib-2.7
          flags:
            regex-posix:
              _regex-posix-clib: true
    • If you are using cabal, update the constraints section of cabal.project.local as follows:
      • constraints:
          regex-posix +_regex-posix-clib 
        

scotty's People

Contributors

5outh avatar abailly avatar abhinav avatar adamflott avatar akii avatar bardurarantsson avatar bgamari avatar chessai avatar chris-martin avatar clockfort avatar clrnd avatar dmjio avatar echaozh avatar edofic avatar ehamberg avatar felixonmars avatar friedbrice avatar fujimura avatar fumieval avatar hakujin avatar konn avatar madnight avatar potomak avatar ryanglscott avatar sebastian-philipp avatar skywriter avatar sol avatar sordina avatar tfausak avatar xich avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.