sanic/docs/getting_started.md

25 lines
573 B
Markdown
Raw Normal View History

2016-10-14 12:51:08 +01:00
# Getting Started
Make sure you have pip and python 3.5 before starting
## Benchmarks
* Install Sanic
* `python3 -m pip install git+https://github.com/channelcat/sanic/`
2016-10-14 12:58:09 +01:00
* Edit main.py to include:
```python
2016-10-14 12:51:08 +01:00
from sanic import Sanic
from sanic.response import json
app = Sanic(__name__)
@app.route("/")
async def test(request):
return json({ "hello": "world" })
app.run(host="0.0.0.0", port=8000, debug=True)
```
* Run `python3 main.py`
2016-10-14 13:00:43 +01:00
You now have a working sanic server! To continue on, check out:
2016-10-14 13:01:18 +01:00
* [Request Data](request_data.md)
* [Routing](routing.md)