danfang / me-api

An extensible, personal API with custom integrations
http://api.danielfang.org
MIT License
823 stars 42 forks source link

404 error on every single route #8

Closed marvinroger closed 9 years ago

marvinroger commented 9 years ago

Hi,

I just installed Me API, and routes all return 404 errors. Looking at the code, I don't understand what happens!

modules.json:

{
    "modules": {
        "medium": {
            "path": "blog",
            "data": {
                "me": "@marvinroger"
            }
        },
        "github": {
            "path": "code",
            "data": {
                "me": "marvinroger"
            }
        }
    },
    "settings": {
        "host": "localhost:3000"
    }
}

me.json:

{
    "name": "Marvin Roger"
}

Logs:

Using standard module: medium on blog                                                                                                                                                                                                      
Using standard module: github on code                                                                                                                                                                                                      
GET / 304 12.854 ms - -                                                                                                                                                                                                                    
GET /blog 404 2.606 ms - 74                                                                                                                                                                                                                
GET /code 404 1.104 ms - 74 

Using node 0.10.25.

marvinroger commented 9 years ago

Got it, it turns out me-api-init generates path without a leading /. Submitting a PR. ;)

lord63 commented 9 years ago

clarify in the prompt is enough, maybe

raw_input('Enter an API endpoint for ' + name + ' (with /): ')

https://github.com/danfang/me-api/blob/master/api/bin/init#L77

lord63 commented 9 years ago

Ah, sorry, didn't see the PR before.

marvinroger commented 9 years ago

No problem!