jacwright / RestServer

A PHP REST server for providing a very light-weight REST API.
MIT License
510 stars 194 forks source link

RestServer in sub directory doen't work #91

Closed turbopixel closed 7 years ago

turbopixel commented 7 years ago

Our rest api doesn't work anymore. Still got a "error: 404" message. The rest api framework can't find the @url /notifications/getAll path with the fix 4024098ed93a4

\Jacwright\RestServer\RestServer::getPath() - Line 368

Before ltrim()

After ltrim()

The RestServer framework called in a sub directory /source/rest/notifications/getAll We received this:

{
    "error": {
        "code": 404,
        "message": "Not Found"
    }
}

Quick solution in our system that works:

$server->addClass('Endpoints\Notification', '//notifications');
tyzoid commented 7 years ago

Sorry for the mixed info - I made a bug (bug #90) once I replicated the issue. Can you verify the bugfix/#90 fixes this?

turbopixel commented 7 years ago

Your commit 0891f7dcf9aacc from #90 fix this bug. Thank you!

tyzoid commented 7 years ago

Alright. Thanks for confirming.