Compare commits
No commits in common. "8cb78cde2edb8c11d25bc268f971be24a9d5dee7" and "7fd8ca7da77bf928ccba3cc52a55f042d05a0570" have entirely different histories.
8cb78cde2e
...
7fd8ca7da7
1 changed files with 10 additions and 0 deletions
10
nodes/main.py
Normal file
10
nodes/main.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import falcon, json
|
||||||
|
|
||||||
|
class CompaniesResource(object):
|
||||||
|
companies = [{"id": 1, "name": "Company One"}, {"id": 2, "name": "Company Two"}]
|
||||||
|
def on_get(self, req, resp):
|
||||||
|
resp.body = json.dumps(self.companies)
|
||||||
|
|
||||||
|
api = falcon.API()
|
||||||
|
companies_endpoint = CompaniesResource()
|
||||||
|
api.add_route('/companies', companies_endpoint)
|
Loading…
Add table
Reference in a new issue