Final tweaks
This commit is contained in:
9
api1.py
9
api1.py
@@ -31,10 +31,7 @@ def sendMail(topic,toAddr):
|
||||
server=smtplib.SMTP("localhost", port)
|
||||
sender_email = "deadswitch@kawomi.com"
|
||||
receiver_email = "joerg.tretter@gmail.com"
|
||||
message = f"""\
|
||||
Subject: deadSwitch not pushed on topic {topic}
|
||||
|
||||
Notification of deadSwitch not pushed on topic {topic}."""
|
||||
message = f"""Subject: deadSwitch not pushed on topic {topic}\n\nNotification of deadSwitch not pushed on topic {topic}."""
|
||||
server.sendmail(sender_email, receiver_email, message)
|
||||
|
||||
|
||||
@@ -82,7 +79,7 @@ if __name__ == '__main__':
|
||||
Examples:
|
||||
<ul>
|
||||
<li>curl "https://deadswitch.kawomi.com/api/v1?topic=sys.demo"</li>
|
||||
<li>curl -X POST "https://deadswitch.kawomi.com/api/v1?topic=sys.demo&secs=60&email=demo@gmail.com"</li>
|
||||
<li>curl -d "" -X POST "https://deadswitch.kawomi.com/api/v1?topic=sys.demo&secs=60&email=demo@demo.com"</li>
|
||||
</ul>"""
|
||||
|
||||
|
||||
@@ -130,4 +127,4 @@ if __name__ == '__main__':
|
||||
|
||||
return jsonify({'success':True, 'expiry':expiryDateTime.strftime("%Y-%m-%d %H:%M:%S"), 'email':email})
|
||||
|
||||
app.run(use_reloader=False)
|
||||
app.run(use_reloader=False,port=5123)
|
||||
|
||||
Reference in New Issue
Block a user