mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-26 14:21:01 +00:00
Pull ENSL url from config
This commit is contained in:
parent
a46113c55f
commit
0131c9b9a7
1 changed files with 5 additions and 6 deletions
|
@ -8,7 +8,6 @@ var Marshal = require("marsha");
|
|||
var querystring = require('querystring');
|
||||
var config = require(path.join(__dirname, "../../config/config"));
|
||||
const SECRET_TOKEN = config.secret_token;
|
||||
var env = process.env.NODE_ENV || "development";
|
||||
|
||||
const MAP_CATEGORY = 45;
|
||||
const SERVER_CATEGORY = 44;
|
||||
|
@ -18,12 +17,12 @@ function EnslClient (options) {
|
|||
return new EnslClient(options);
|
||||
}
|
||||
|
||||
this.baseUrl = (env === "production") ? "http://www.ensl.org" : "http://staging.ensl.org";
|
||||
this.baseUrl = config.ensl_url;
|
||||
}
|
||||
|
||||
EnslClient.prototype.getUserById = (options, callback) => {
|
||||
var id = options.id;
|
||||
var url = this.baseUrl + "/api/v1/users/" + id;
|
||||
var url = this.baseUrl + "api/v1/users/" + id;
|
||||
return request({
|
||||
url: url,
|
||||
json: true
|
||||
|
@ -31,7 +30,7 @@ EnslClient.prototype.getUserById = (options, callback) => {
|
|||
};
|
||||
|
||||
EnslClient.prototype.getServers = callback => {
|
||||
const url = this.baseUrl + "/api/v1/servers";
|
||||
const url = this.baseUrl + "api/v1/servers";
|
||||
return request({
|
||||
url: url,
|
||||
json: true
|
||||
|
@ -46,7 +45,7 @@ EnslClient.prototype.getServers = callback => {
|
|||
};
|
||||
|
||||
EnslClient.prototype.getMaps = callback => {
|
||||
const url = this.baseUrl + "/api/v1/maps";
|
||||
const url = this.baseUrl + "api/v1/maps";
|
||||
return request({
|
||||
url: url,
|
||||
json: true
|
||||
|
@ -61,7 +60,7 @@ EnslClient.prototype.getMaps = callback => {
|
|||
};
|
||||
|
||||
EnslClient.prototype.getFullAvatarUri = url => {
|
||||
return this.baseUrl + url;
|
||||
return this.baseUrl + url.replace(/^\//, "");
|
||||
};
|
||||
|
||||
EnslClient.parseCookies = (socket) => {
|
||||
|
|
Loading…
Reference in a new issue