Changes configuration example base_url for subdomainless users

This commit is contained in:
Raul Ochoa 2015-04-08 16:13:04 +02:00
parent 351f9d763d
commit 8fe4224a55
5 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
// In case the base_url has a :user param the username will be the one specified in the URL,
// otherwise it will fallback to extract the username from the host header.
module.exports.base_url = '(?:/api/:version|/u/:user/api/:version)';
module.exports.base_url = '(?:/api/:version|/user/:user/api/:version)';
// If useProfiler is true every response will be served with an
// X-SQLAPI-Profile header containing elapsed timing for various
// steps taken for producing the response.

View File

@ -1,6 +1,6 @@
// In case the base_url has a :user param the username will be the one specified in the URL,
// otherwise it will fallback to extract the username from the host header.
module.exports.base_url = '(?:/api/:version|/u/:user/api/:version)';
module.exports.base_url = '(?:/api/:version|/user/:user/api/:version)';
// If useProfiler is true every response will be served with an
// X-SQLAPI-Profile header containing elapsed timing for various
// steps taken for producing the response.

View File

@ -1,6 +1,6 @@
// In case the base_url has a :user param the username will be the one specified in the URL,
// otherwise it will fallback to extract the username from the host header.
module.exports.base_url = '(?:/api/:version|/u/:user/api/:version)';
module.exports.base_url = '(?:/api/:version|/user/:user/api/:version)';
// If useProfiler is true every response will be served with an
// X-SQLAPI-Profile header containing elapsed timing for various
// steps taken for producing the response.

View File

@ -1,6 +1,6 @@
// In case the base_url has a :user param the username will be the one specified in the URL,
// otherwise it will fallback to extract the username from the host header.
module.exports.base_url = '(?:/api/:version|/u/:user/api/:version)';
module.exports.base_url = '(?:/api/:version|/user/:user/api/:version)';
// If useProfiler is true every response will be served with an
// X-SQLAPI-Profile header containing elapsed timing for various
// steps taken for producing the response.

View File

@ -147,9 +147,9 @@ test('GET /api/v1/sql with SQL parameter on SELECT only. no database param, just
});
});
test('GET /u/vizzuality/api/v1/sql with SQL parameter on SELECT only', function(done){
test('GET /user/vizzuality/api/v1/sql with SQL parameter on SELECT only', function(done){
assert.response(app, {
url: '/u/vizzuality/api/v1/sql?q=SELECT%20*%20FROM%20untitle_table_4',
url: '/user/vizzuality/api/v1/sql?q=SELECT%20*%20FROM%20untitle_table_4',
method: 'GET'
},{ }, function(res) {
assert.equal(res.statusCode, 200, res.body);