17 lines
315 B
Python
17 lines
315 B
Python
import asyncio
|
|
|
|
from sanic import Sanic
|
|
|
|
app = Sanic("Example")
|
|
|
|
|
|
async def notify_server_started_after_five_seconds():
|
|
await asyncio.sleep(5)
|
|
print("Server successfully started!")
|
|
|
|
|
|
app.add_task(notify_server_started_after_five_seconds())
|
|
|
|
if __name__ == "__main__":
|
|
app.run(host="0.0.0.0", port=8000)
|