Provides a JSON REST API to access business information.
- Node 6.x or above
- sqlite3
npm install
After dependencies are installed:
- Add unzipped CSV into
./resources
and name fileengineering_project_businesses.csv
- Run
node src/install/index.js
. This will create a sqlite3 database file indb/data.sqlite3
npm run app
App will be hosted on http://localhost:3000
npm test
{
"id": 1,
"uuid": "2859d6e0-1cb9-4fe9-bc00-97823a9fa4cb",
"name": "Business name",
"address": "1 Street",
"address2": "Suite 2",
"city": "Austin",
"state": "TX",
"zip": "78704",
"country": "US",
"phone": "5551112323",
"website": "http://example.com",
"created_at": "2012-12-10 16:17:58"
}
GET /businesses/{id}
Responses:
-
200 OK
Body:business
model -
404 Not Found
GET /businesses[?page=1[&limit=50]]
Responses:
-
200 OK
Body:{ "pagination": { "total": 100 }, "businesses": "[business]" }
-
400 Bad Request
Body:{ "message": "Application-specific error message" }