Auto-update by eslint --fix
This commit is contained in:
parent
144fc8000d
commit
2987655479
|
@ -6,7 +6,7 @@ var port = 3000;
|
||||||
var Product = loopback.PersistedModel.extend('product', {
|
var Product = loopback.PersistedModel.extend('product', {
|
||||||
foo: { type: 'string', required: true },
|
foo: { type: 'string', required: true },
|
||||||
bar: 'string',
|
bar: 'string',
|
||||||
aNum: {type: 'number', min: 1, max: 10, required: true, default: 5}
|
aNum: { type: 'number', min: 1, max: 10, required: true, default: 5 },
|
||||||
});
|
});
|
||||||
Product.attachTo(loopback.memory());
|
Product.attachTo(loopback.memory());
|
||||||
app.model(Product);
|
app.model(Product);
|
||||||
|
|
4
index.js
4
index.js
|
@ -39,7 +39,7 @@ function routes(loopbackApplication, options) {
|
||||||
options = _defaults({}, options, {
|
options = _defaults({}, options, {
|
||||||
resourcePath: 'swagger.json',
|
resourcePath: 'swagger.json',
|
||||||
apiInfo: loopbackApplication.get('apiInfo') || {},
|
apiInfo: loopbackApplication.get('apiInfo') || {},
|
||||||
swaggerUI: true
|
swaggerUI: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
var router = new loopback.Router();
|
var router = new loopback.Router();
|
||||||
|
@ -57,7 +57,7 @@ function routes(loopbackApplication, options) {
|
||||||
source = req.originalUrl.replace(/\/config.json(\?.*)?$/, '');
|
source = req.originalUrl.replace(/\/config.json(\?.*)?$/, '');
|
||||||
}
|
}
|
||||||
res.send({
|
res.send({
|
||||||
url: urlJoin(source, '/' + options.resourcePath)
|
url: urlJoin(source, '/' + options.resourcePath),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ $(function() {
|
||||||
return pathCompare !== 0 ?
|
return pathCompare !== 0 ?
|
||||||
pathCompare :
|
pathCompare :
|
||||||
methodOrder.indexOf(a.method) - methodOrder.indexOf(b.method);
|
methodOrder.indexOf(a.method) - methodOrder.indexOf(b.method);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#explore').click(setAccessToken);
|
$('#explore').click(setAccessToken);
|
||||||
|
|
|
@ -117,7 +117,7 @@ describe('explorer', function() {
|
||||||
beforeEach(function setupExplorerWithUiDirs() {
|
beforeEach(function setupExplorerWithUiDirs() {
|
||||||
app = loopback();
|
app = loopback();
|
||||||
explorer(app, {
|
explorer(app, {
|
||||||
uiDirs: [path.resolve(__dirname, 'fixtures', 'dummy-swagger-ui')]
|
uiDirs: [path.resolve(__dirname, 'fixtures', 'dummy-swagger-ui')],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ describe('explorer', function() {
|
||||||
beforeEach(function setupExplorerWithoutUI() {
|
beforeEach(function setupExplorerWithoutUI() {
|
||||||
app = loopback();
|
app = loopback();
|
||||||
explorer(app, {
|
explorer(app, {
|
||||||
swaggerUI: false
|
swaggerUI: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ describe('explorer', function() {
|
||||||
|
|
||||||
it('should allow `uiDirs` to be defined as an Array', function(done) {
|
it('should allow `uiDirs` to be defined as an Array', function(done) {
|
||||||
explorer(app, {
|
explorer(app, {
|
||||||
uiDirs: [path.resolve(__dirname, 'fixtures', 'dummy-swagger-ui')]
|
uiDirs: [path.resolve(__dirname, 'fixtures', 'dummy-swagger-ui')],
|
||||||
});
|
});
|
||||||
|
|
||||||
request(app).get('/explorer/')
|
request(app).get('/explorer/')
|
||||||
|
@ -212,7 +212,7 @@ describe('explorer', function() {
|
||||||
|
|
||||||
it('should allow `uiDirs` to be defined as an String', function(done) {
|
it('should allow `uiDirs` to be defined as an String', function(done) {
|
||||||
explorer(app, {
|
explorer(app, {
|
||||||
uiDirs: path.resolve(__dirname, 'fixtures', 'dummy-swagger-ui')
|
uiDirs: path.resolve(__dirname, 'fixtures', 'dummy-swagger-ui'),
|
||||||
});
|
});
|
||||||
|
|
||||||
request(app).get('/explorer/')
|
request(app).get('/explorer/')
|
||||||
|
|
Loading…
Reference in New Issue