servant/doc/tutorial/index.rst

55 lines
1.5 KiB
ReStructuredText
Raw Normal View History

2016-02-18 17:02:11 +01:00
Tutorial
========
2016-01-25 14:11:40 +01:00
This is an introductory tutorial to **servant**. Whilst browsing is fine, it makes more sense if you read the sections in order, or at least read the first section before anything else.
2016-02-18 22:12:27 +01:00
2018-06-10 00:43:02 +02:00
Any comments, issues or feedback about the tutorial can be submitted
to `servant's issue tracker <http://github.com/haskell-servant/servant/issues>`_.
2016-01-25 14:11:40 +01:00
cabal-install
--------
The whole tutorial is a `cabal <https://cabal.readthedocs.io/en/latest/>`_
project and can be built locally as follows:
2018-06-10 00:43:02 +02:00
.. code-block:: bash
$ git clone https://github.com/haskell-servant/servant.git
$ cd servant
# build
$ cabal new-build tutorial
# load in ghci to play with it
$ cabal new-repl tutorial
stack
--------
The servant `stack <https://docs.haskellstack.org/en/stable/README/>`_ template includes the working tutorial. To initialize this template, run:
.. code-block:: bash
$ stack new myproj servant
$ cd myproj
# build
$ stack build
# start server
$ stack exec myproj-exe
2018-06-10 00:43:02 +02:00
The code can be found in the `*.lhs` files under `doc/tutorial/` in the
repository. Feel free to edit it while you're reading this documentation and
see the effect of your changes.
`Nix <https://nixos.org/nix/>`_ users should feel free to take a look at
the `nix/shell.nix` file in the repository and use it to provision a suitable
environment to build and run the examples.
2016-01-25 14:11:40 +01:00
.. toctree::
:maxdepth: 1
2016-01-25 14:11:40 +01:00
2016-01-27 22:58:38 +01:00
ApiType.lhs
Server.lhs
Client.lhs
Javascript.lhs
Docs.lhs
Authentication.lhs