mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-02-18 09:51:26 +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 querystring = require('querystring');
|
||||||
var config = require(path.join(__dirname, "../../config/config"));
|
var config = require(path.join(__dirname, "../../config/config"));
|
||||||
const SECRET_TOKEN = config.secret_token;
|
const SECRET_TOKEN = config.secret_token;
|
||||||
var env = process.env.NODE_ENV || "development";
|
|
||||||
|
|
||||||
const MAP_CATEGORY = 45;
|
const MAP_CATEGORY = 45;
|
||||||
const SERVER_CATEGORY = 44;
|
const SERVER_CATEGORY = 44;
|
||||||
|
@ -18,12 +17,12 @@ function EnslClient (options) {
|
||||||
return new 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) => {
|
EnslClient.prototype.getUserById = (options, callback) => {
|
||||||
var id = options.id;
|
var id = options.id;
|
||||||
var url = this.baseUrl + "/api/v1/users/" + id;
|
var url = this.baseUrl + "api/v1/users/" + id;
|
||||||
return request({
|
return request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
|
@ -31,7 +30,7 @@ EnslClient.prototype.getUserById = (options, callback) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
EnslClient.prototype.getServers = callback => {
|
EnslClient.prototype.getServers = callback => {
|
||||||
const url = this.baseUrl + "/api/v1/servers";
|
const url = this.baseUrl + "api/v1/servers";
|
||||||
return request({
|
return request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
|
@ -46,7 +45,7 @@ EnslClient.prototype.getServers = callback => {
|
||||||
};
|
};
|
||||||
|
|
||||||
EnslClient.prototype.getMaps = callback => {
|
EnslClient.prototype.getMaps = callback => {
|
||||||
const url = this.baseUrl + "/api/v1/maps";
|
const url = this.baseUrl + "api/v1/maps";
|
||||||
return request({
|
return request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
|
@ -61,7 +60,7 @@ EnslClient.prototype.getMaps = callback => {
|
||||||
};
|
};
|
||||||
|
|
||||||
EnslClient.prototype.getFullAvatarUri = url => {
|
EnslClient.prototype.getFullAvatarUri = url => {
|
||||||
return this.baseUrl + url;
|
return this.baseUrl + url.replace(/^\//, "");
|
||||||
};
|
};
|
||||||
|
|
||||||
EnslClient.parseCookies = (socket) => {
|
EnslClient.parseCookies = (socket) => {
|
||||||
|
|
Loading…
Reference in a new issue