Skip to content

Commit

Permalink
Merge pull request #117 from hackforla/feature_server_routes
Browse files Browse the repository at this point in the history
created ingress service
  • Loading branch information
sellnat77 authored Dec 8, 2019
2 parents 90ea7e4 + 314da88 commit c744426
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ coverage/
.env.development.local
.env.test.local
.env.production.local
.vscode

npm-debug.log*
yarn-debug.log*
Expand Down
19 changes: 19 additions & 0 deletions server/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from sanic.response import json
from services.time_to_close import time_to_close
from services.frequency import frequency
from services.ingress_service import ingress_service

app = Sanic(__name__)
app.config.from_pyfile(os.path.join(os.getcwd(),'settings.cfg'))
Expand Down Expand Up @@ -32,5 +33,23 @@ async def sample_route(request):
sample_dataset = {'cool_key':['value1', 'value2'], app.config['REDACTED']:app.config['REDACTED']}
return json(sample_dataset)

@app.route('/injest')
async def injest(request):
ingress_worker = ingress_service()
return_data = ingress_worker.injest()
return json(return_data)

@app.route('/update')
async def update(request):
ingress_worker = ingress_service()
return_data = ingress_worker.update()
return json(return_data)

@app.route('/delete')
async def delete(request):
ingress_worker = ingress_service()
return_data = ingress_worker.delete()
return json(return_data)

if __name__ == '__main__':
app.run(host=app.config['HOST'], port=app.config['PORT'], debug=app.config['DEBUG'])
15 changes: 15 additions & 0 deletions server/src/services/ingress_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class ingress_service(object):
def __init__(self):
pass

def injest(self):
return {'response':'injest ok'}

def update(self):
return {'response':'update ok'}

def delete(self):
return {'response':'delete ok'}

def hello_world(self):
return {'response':'hello from frequency service'}

0 comments on commit c744426

Please sign in to comment.