I've been given a home assignment for a job interview. For me to get going I need to work with an API end point they've provided me but I can't get it running for some reason. It should be straight forward but I keep getting 404 back.
This is my package.json
:
{
"name": "frontend-dev-assignment",
"version": "0.1.0",
"private": true,
"dependencies": {
"canned": "0.3.12"
},
"devDependencies": {
"concurrently": "3.5.1"
},
"scripts": {
"start": "canned -p 5000 ./api/"
},
"proxy": "http://localhost:5000"
}
In that same directory I have a folder named api
and in it a file called _search.get.json
. This is the contents of that file (shortened):
[
{
"term": "Abyssinian",
"resultCount": 61
},
{
"term": "Aegean",
"resultCount": 26
},
{
"term": "American Curl",
"resultCount": 56
}
]
In the parent folder I ran npm install
and then npm start
. I got this line in my CLI:
starting canned on port 5000 for C:\Users\Yanay\Documents\Coding\Autocomplete\api
(Autocoplete is that parent folder).
But when I try to access http://localhost:5000/
or http://localhost:5000//search?q=xxxx
I keep getting a 404 back.
What could I be doing wrong here?