Skip to content

Commit

Permalink
Update api_endpoints.py
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurahman-ctis committed Dec 1, 2019
1 parent 420f65c commit fb60ad7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def initialize(self, handlers):

async def post(self):
params = json.loads(self.request.body)
prev = intrusion_ref.get(params['path'])
print(params)
prev = intrusion_ref.child(params['path']).get()
print(prev)
if not prev:
cnt = 1
Expand All @@ -155,10 +156,10 @@ async def post(self):
else:
cnt += 1

ref.push({
intrusion_ref.push({
"ip": self.request.remote_ip,
"path": params['path'],
"time": datetime.datetime.now(),
"time": datetime.datetime.now().isoformat(),
"cnt": cnt
})
self.write({"Result": "200 Success"})

0 comments on commit fb60ad7

Please sign in to comment.