Make BASE_API more explicit & Fix typo

This commit is contained in:
Etienne Dldc committed 2017-11-19 01:34:44 +01:00
1 parent 38b15a02f2
commit a1e6a95f13
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ Change the endpoint for the backend server to your debug instance by editing thi
`/captainduckduck/app-frontend/src/js/captain/apiManager.js` and
change `var BASE_API = '/api/v1/'` to
- `var BASE_API = 'http://captain.captain.x/api/v1/'` if you have dnsmasq installed
- `var BASE_API = 'http://127.0.0.1:3000/api/v1/'` if you have dnsmasq installed
- `var BASE_API = 'http://127.0.0.1:3000/api/v1/'` if you don't have dnsmasq installed
You need to hardcode a logged in user to avoid having to log it with every refresh of the page. To do so, steal the auth token from the the network inspector on Chrome and hardcode it in apiManager.js.
You can simply replace `var authToken = null` with `var authToken = 'THE_AUTH_TOKEN_STOLEN_FROM_NETWORK_INSPECTOR'`
+7 -2
View File
@@ -2,11 +2,16 @@
angular.module('RDash')
.factory('apiManager', ApiManager);
var BASE_API = '/api/v1/'; // 'http://captain.captain.x/';
var BASE_API = '/api/v1/';
var TOKEN_HEADER = 'x-captain-auth';
var NAMESPACE = 'x-namespace';
var CAPTAIN = 'captain';
// In developement
// Uncomment the following line if you have dnsmasq installed
// BASE_API = 'http://captain.captain.x/api/v1';
// Uncomment the following line if you don't have dnsmasq installed
// BASE_API = 'http://127.0.0.1:3000/api/v1/';
function ApiManager(captainLogger, $http, $timeout) {