Init basic sanic server
This commit is contained in:
parent
4bf6f5ee1b
commit
94d3ee5d2a
2 changed files with 13 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
||||||
|
from sanic import Sanic
|
||||||
|
from sanic.response import json
|
||||||
|
|
||||||
|
app = Sanic()
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
async def test(request):
|
||||||
|
return json({"hello": "world"})
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
app.run(host="0.0.0.0", port="8000")
|
1
setup.py
1
setup.py
|
@ -5,6 +5,7 @@ setup(
|
||||||
name="lantern",
|
name="lantern",
|
||||||
version="1.0",
|
version="1.0",
|
||||||
install_requires=[
|
install_requires=[
|
||||||
|
"sanic==0.4.1"
|
||||||
],
|
],
|
||||||
entry_points="""
|
entry_points="""
|
||||||
[console_scripts]
|
[console_scripts]
|
||||||
|
|
Reference in a new issue