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

Disable log files in sanic server #38

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all: elixir node ruby crystal go rust swift client benchmarker
all: elixir node ruby crystal go rust swift python client benchmarker

# --- Elixir ---
elixir: plug phoenix
Expand Down Expand Up @@ -113,6 +113,14 @@ kitura:
cd swift/kitura; swift build --configuration release
ln -s -f ../swift/kitura/.build/release/server_swift_kitura bin/.

# --- Python ---
python: sanic

# Sanic
sanic:
cd python/sanic; pip3 install -r requirements.txt; chmod +x server_python_sanic.py
ln -s -f ../python/sanic/server_python_sanic.py bin/server_python_sanic

# --- Benchmarker ---
# client
client:
Expand All @@ -127,3 +135,4 @@ benchmarker:
# Cleaning all executables
clean:
rm -rf bin/*
rm -rf *.log
10 changes: 10 additions & 0 deletions python/sanic/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
aiofiles==0.3.1
appdirs==1.4.3
httptools==0.0.9
packaging==16.8
pyparsing==2.2.0
sanic==0.5.4
six==1.10.0
ujson==1.35
uvloop==0.8.0
websockets==3.3
26 changes: 26 additions & 0 deletions python/sanic/server_python_sanic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3.5
# -*- coding: utf-8 -*-

from sanic import Sanic
from sanic.response import text

app = Sanic(log_config=None)

@app.route("/")
async def index(request):
return text('')


@app.route("/user/<id:int>", methods=['GET'])
async def user_info(request, id):
return text(str(id))


@app.route("/user", methods=['POST'])
async def user(request):
return text('')


if __name__ == '__main__':
app.config.LOGO=None
app.run(port=3000, log_config=None)