The removal of the current-context API in alpha.3 appears to have broken something. This can be seen with a simple example app:
mkdir api
cd api
slc loopback
With options:
After install, running node . and executing GET /api/Users returns:
Unhandled error for request GET /api/Users: Error: remoting.context option was removed in version 3.0. See https://docs.strongloop.com/display/APIC/Using%20current%20context for more details.
at restApiHandler (/Users/dev/api2/node_modules/loopback/server/middleware/rest.js:44:15)
at Layer.handle [as handle_request] (/Users/dev/api2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/dev/api2/node_modules/express/lib/router/index.js:312:13)
at /Users/dev/api2/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/Users/dev/api2/node_modules/express/lib/router/index.js:330:12)
at next (/Users/dev/api2/node_modules/express/lib/router/index.js:271:10)
at /Users/dev/api2/node_modules/express/lib/router/index.js:618:15
at next (/Users/dev/api2/node_modules/express/lib/router/index.js:256:14)
at Function.handle (/Users/dev/api2/node_modules/express/lib/router/index.js:176:3)
at router (/Users/dev/api2/node_modules/express/lib/router/index.js:46:12)
at Layer.handle [as handle_request] (/Users/dev/api2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/dev/api2/node_modules/express/lib/router/index.js:312:13)
at /Users/dev/api2/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/Users/dev/api2/node_modules/express/lib/router/index.js:330:12)
at next (/Users/dev/api2/node_modules/express/lib/router/index.js:271:10)
at nosniff (/Users/dev/api2/node_modules/dont-sniff-mimetype/index.js:4:5)
on the first execution, subsequent executions then return:
Unhandled error for request GET /api/Users: Error: Cannot GET /api/Users
at raiseUrlNotFoundError (/Users/dev/api2/node_modules/loopback/server/middleware/url-not-found.js:20:17)
at Layer.handle [as handle_request] (/Users/dev/api2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/dev/api2/node_modules/express/lib/router/index.js:312:13)
at /Users/dev/api2/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/Users/dev/api2/node_modules/express/lib/router/index.js:330:12)
at next (/Users/dev/api2/node_modules/express/lib/router/index.js:271:10)
at /Users/dev/api2/node_modules/async/dist/async.js:486:20
at replenish (/Users/dev/api2/node_modules/async/dist/async.js:879:29)
at /Users/dev/api2/node_modules/async/dist/async.js:888:13
at eachLimit$1 (/Users/dev/api2/node_modules/async/dist/async.js:3136:26)
at Object.<anonymous> (/Users/dev/api2/node_modules/async/dist/async.js:920:20)
at restApiHandler (/Users/dev/api2/node_modules/loopback/server/middleware/rest.js:63:11)
at Layer.handle [as handle_request] (/Users/dev/api2/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/dev/api2/node_modules/express/lib/router/index.js:312:13)
at /Users/dev/api2/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/Users/dev/api2/node_modules/express/lib/router/index.js:330:12)
Following the 3.0-RELEASE-NOTES and adding loopback-context does nothing to resolve the issue or change the behaviour. The same configuration with alpha.1 and alpha.2 works fine.
The slc loopback installer also makes no note that 3.x is still in alpha.
Should be fixed with latest [email protected] release. Could you please try again and let me know if it works for you? Thanks!
Following the 3.0-RELEASE-NOTES and adding loopback-context does nothing to resolve the issue or change the behaviour. The same configuration with alpha.1 and alpha.2 works fine.
The instructions are here: https://docs.strongloop.com/display/APIC/Using+current+context#Usingcurrentcontext-Fixingdeprecationwarnings
I have opened a PR to add upgrading instructions to release notes, see https://github.com/strongloop/loopback/pull/2721
I am closing this issue as fixed. @rogersnm feel free to reopen if the problem still persists.
i am having same kind of issue when i open localhost i get Cannot GET / why is that
btw i am converting a soap api to rest api
i am also not able to connect to a magento wsdl all other wsdl work fine is there any solution
@ghulamhussain thank you for the comment. Please open a new github issue and provide us with steps how to reproduce the problem you are experiencing - see http://loopback.io/doc/en/contrib/Reporting-issues.html#bug-report
Most helpful comment
The
slc loopbackinstaller also makes no note that3.xis still in alpha.