Skip to content

Commit

Permalink
Bump eslint-config-brightspace from 0.24.0 to 0.25.0 (#53)
Browse files Browse the repository at this point in the history
* Bump eslint-config-brightspace from 0.24.0 to 0.25.0

Bumps [eslint-config-brightspace](https://github.com/Brightspace/eslint-config-brightspace) from 0.24.0 to 0.25.0.
- [Release notes](https://github.com/Brightspace/eslint-config-brightspace/releases)
- [Commits](Brightspace/eslint-config-brightspace@v0.24.0...v0.25.0)

---
updated-dependencies:
- dependency-name: eslint-config-brightspace
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update appresolver.js

* Update appresolver.js

* Update index.js

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dave Lockhart <[email protected]>
  • Loading branch information
dependabot[bot] and dlockhart authored Aug 4, 2023
1 parent 16a3d76 commit 1b65c11
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"chai": "^4",
"eslint": "^8",
"eslint-config-brightspace": "^0.24",
"eslint-config-brightspace": "^0.25",
"mocha": "^10",
"request": "^2"
}
Expand Down
20 changes: 10 additions & 10 deletions src/appresolver.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

var corsProxy = require('superagent-d2l-cors-proxy'),
const corsProxy = require('superagent-d2l-cors-proxy'),
chalk = require('chalk'),
os = require('os'),
dns = require('dns'),
deasync = require('deasync');

var getFQDN = deasync(function(cb) {
var uqdn = os.hostname();
const getFQDN = deasync(function(cb) {
const uqdn = os.hostname();
dns.lookup(uqdn, { hints: dns.ADDRCONFIG }, function(err, ip) {
if (err) {
return cb(err);
Expand All @@ -22,7 +22,7 @@ var getFQDN = deasync(function(cb) {
});

function getHostname(opts) {
var hostname = opts.hostname || getFQDN() || os.hostname();
let hostname = opts.hostname || getFQDN() || os.hostname();
if (hostname.indexOf('.local', hostname.length - 6) !== -1) {
hostname = hostname.substr(0, hostname.length - 6);
}
Expand All @@ -49,16 +49,16 @@ function LocalAppRegistry(appClass, opts) {

LocalAppRegistry.prototype.host = function() {

var self = this;
var app = require('express')();
var cors = require('cors');
var serveStatic = require('serve-static');
const self = this;
const app = require('express')();
const cors = require('cors');
const serveStatic = require('serve-static');

app.use(cors());

app.use(this._opts.baseRoute, serveStatic(self._opts.dist));

var encodedAppClass = encodeURIComponent(self._opts.appClass);
const encodedAppClass = encodeURIComponent(self._opts.appClass);
app.get('/resolve/' + encodedAppClass, function(req, res) {
res.json({ url: self.getConfigUrl() });
});
Expand Down Expand Up @@ -88,7 +88,7 @@ LocalAppRegistry.prototype.close = function() {
};

LocalAppRegistry.prototype.getUrl = function() {
var base = this._opts.publicEndpoint ||
const base = this._opts.publicEndpoint ||
('http://' + this._opts.hostname + ':' + this._opts.port);
return base + this._opts.baseRoute + '/';
};
Expand Down
16 changes: 8 additions & 8 deletions test/appresolver.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

var appresolver = require('../src/appresolver'),
const appresolver = require('../src/appresolver'),
corsProxy = require('superagent-d2l-cors-proxy'),
request = require('request'),
chai = require('chai');

var expect = chai.expect;
const expect = chai.expect;

var APP_CLASS = 'urn:d2l:fra:class:some-class',
const APP_CLASS = 'urn:d2l:fra:class:some-class',
DEFAULT_PORT = 3000;

describe('appresolver', function() {
Expand Down Expand Up @@ -117,8 +117,8 @@ describe('appresolver', function() {
});

it('should serve resolution', function(cb) {
var url = 'http://localhost:' + DEFAULT_PORT + '/resolve/' + encodeURIComponent(APP_CLASS);
var expectedUrl = 'http://localhost:' + DEFAULT_PORT + '/app/appconfig.json';
const url = 'http://localhost:' + DEFAULT_PORT + '/resolve/' + encodeURIComponent(APP_CLASS);
const expectedUrl = 'http://localhost:' + DEFAULT_PORT + '/app/appconfig.json';
request.get(url, function(error, response, body) {
if (error) {
cb(error);
Expand All @@ -133,7 +133,7 @@ describe('appresolver', function() {
});

it('should not serve resolution when trying to resolve app-class that is not being hosted', function(cb) {
var url = 'http://localhost:' + DEFAULT_PORT + '/resolve/some-other-app-class';
const url = 'http://localhost:' + DEFAULT_PORT + '/resolve/some-other-app-class';
request.get(url, function(error, response) {
if (error) {
cb(error);
Expand All @@ -146,7 +146,7 @@ describe('appresolver', function() {
});

it('should serve static files', function(cb) {
var url = 'http://localhost:' + DEFAULT_PORT + '/app/staticFileToBeServed.txt';
const url = 'http://localhost:' + DEFAULT_PORT + '/app/staticFileToBeServed.txt';
request.get(url, function(error, response, body) {
if (error) {
cb(error);
Expand All @@ -161,7 +161,7 @@ describe('appresolver', function() {
});

it('should serve CORS proxy', function(cb) {
var url = 'http://localhost:' + DEFAULT_PORT + corsProxy.getProxyDefaultLocation();
const url = 'http://localhost:' + DEFAULT_PORT + corsProxy.getProxyDefaultLocation();
request.get(url, function(err, res) {
if (err)
return cb(err);
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var chai = require('chai'),
const chai = require('chai'),
expect = chai.expect,
appresolver = require('../src/index');

Expand Down

0 comments on commit 1b65c11

Please sign in to comment.