I am on Amazon EC2 DSP 1.7.8.
Following your docs on AngularJS this is how I am declaring my constants:-
angular.module(‘starter’, [‘ionic’, ‘starter.controllers’, ‘starter.services’,‘ngDreamFactory’])
.constant(‘DSP_URL’, ‘My Url Here’)
.constant(‘DSP_API_KEY’, ‘sql’)
The URL above starts with http:// and is the ec2 instance address.
This is the error I get in the console when the app starts:-
GET –MY URL Here–/rest/api_docs 403 (Forbidden)
undefined : undefined --My Url Here–/rest/api_docs
The above error comes, even though I have not yet made any call to the DSP, so I assume it must be the framework making this call.
Just to confirm that my DSP is set up correctly and my URL is correct, this is what I get when I paste this in the browser:-
–My Url Here–/rest/api_docs?app_name=sql
{“swaggerVersion”:“1.2”,“apiVersion”:“1.0”,“authorizations”:{“apiKey”:{“type”:“apiKey”,“passAs”:“header”}},“info”:{“title”:“DreamFactory Live API Documentation",“description”:"",“contact”:"support@dreamfactory.com”,“license”:“Apache 2.0”,“licenseUrl”:“http://www.apache.org/licenses/LICENSE-2.0.html"},“events”:[“swagger.cache_cleared”,“swagger.cache_rebuilt”],“apis”:[{“path”:"/user",“description”:"User session and profile”},{“path”:"/system",“description”:“System configuration”},{“path”:"/db",“description”:“Local database access”},{“path”:"/email",“description”:“Email utility access”},{“path”:"/files",“description”:“Local file storage access”},{“path”:"/sql",“description”:“Amazon RDS Sql”}]}
Therefore, I assume the set up is correct.
At the DSP end:-
- I have defined a role, as “Amazon RDS” and have given service access of ‘sql’ to this role.
- In the CORS access inside Config, I have added * in the Host and selected all the HTTP verbs and enabled the same.
- Checked the “Allow Guest Users” and also Selected the role “Amazon RDS” for guest users.
So, when I make this call later in my code:- DreamFactory.api.db.getRecords
I get the error:- TypeError: Cannot read property ‘getRecords’ of undefined
Because the setup service itself is not getting instantiated properly.
Any help in this regard would be helpful.
Also, please don’t suggest me up-grading to 1.8.0 because whenever I try to upgrade, the screen gets white, even in the AWS instance, and I have to do everything again.
I have been following up with the support on the white screen upgrade issue, but that issue seems unresolved still.