mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
- Remove "prettier" from plugin array, because it's already enabled by "plugin:prettier/recommended" - Remove "jsdoc" from plugin array, because it's already enabled by "plugin:jsdoc/recommended" - Enable recommended import rules - Add two additional import rules Note: To avoid overloading this PR I'll tackle the jest part with another PR after this one has been dealt with.
31 lines
666 B
JavaScript
31 lines
666 B
JavaScript
const path = require("path");
|
|
const auth = require("express-basic-auth");
|
|
const express = require("express");
|
|
|
|
const app = express();
|
|
|
|
const basicAuth = auth({
|
|
realm: "MagicMirror² Area restricted.",
|
|
users: { MagicMirror: "CallMeADog" }
|
|
});
|
|
|
|
app.use(basicAuth);
|
|
|
|
// Set available directories
|
|
const directories = ["/tests/configs", "/tests/mocks"];
|
|
const rootPath = path.resolve(`${__dirname}/../../../`);
|
|
|
|
for (let directory of directories) {
|
|
app.use(directory, express.static(path.resolve(rootPath + directory)));
|
|
}
|
|
|
|
let server;
|
|
|
|
exports.listen = (...args) => {
|
|
server = app.listen.apply(app, args);
|
|
};
|
|
|
|
exports.close = async () => {
|
|
await server.close();
|
|
};
|