diff --git a/nodes/main.py b/nodes/main.py new file mode 100644 index 0000000..e232242 --- /dev/null +++ b/nodes/main.py @@ -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) \ No newline at end of file