@unchainedshop/admin-ui 3.0.14 → 3.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/express.js +7 -12
- package/dist/fastify.js +5 -10
- package/dist/index.js +3 -10
- package/package.json +1 -1
package/dist/express.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const express_1 = __importDefault(require("express"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const expressRouter = express_1.default.Router();
|
|
9
|
-
const staticPath = path_1.default.join(__dirname, '..', 'out');
|
|
10
|
-
expressRouter.use(express_1.default.static(staticPath));
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
const expressRouter = express.Router();
|
|
4
|
+
const staticPath = path.join(__dirname, '..', 'out');
|
|
5
|
+
expressRouter.use(express.static(staticPath));
|
|
11
6
|
expressRouter.get(/(.*)/, (_, res) => {
|
|
12
|
-
res.sendFile(
|
|
7
|
+
res.sendFile(path.join(staticPath, 'index.html'));
|
|
13
8
|
});
|
|
14
|
-
|
|
9
|
+
export default expressRouter;
|
package/dist/fastify.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const static_1 = __importDefault(require("@fastify/static"));
|
|
8
|
-
const staticPath = path_1.default.join(__dirname, '..', 'out');
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fastifyStatic from '@fastify/static';
|
|
3
|
+
const staticPath = path.join(__dirname, '..', 'out');
|
|
9
4
|
const fastifyRouter = async (fastify, opts) => {
|
|
10
|
-
fastify.register(
|
|
5
|
+
fastify.register(fastifyStatic, {
|
|
11
6
|
root: staticPath,
|
|
12
7
|
prefix: opts.prefix || '/',
|
|
13
8
|
});
|
|
@@ -20,4 +15,4 @@ const fastifyRouter = async (fastify, opts) => {
|
|
|
20
15
|
}
|
|
21
16
|
});
|
|
22
17
|
};
|
|
23
|
-
|
|
18
|
+
export default fastifyRouter;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.expressRouter = exports.fastifyRouter = void 0;
|
|
7
|
-
const fastify_1 = __importDefault(require("./fastify"));
|
|
8
|
-
exports.fastifyRouter = fastify_1.default;
|
|
9
|
-
const express_1 = __importDefault(require("./express"));
|
|
10
|
-
exports.expressRouter = express_1.default;
|
|
1
|
+
import fastifyRouter from './fastify';
|
|
2
|
+
import expressRouter from './express';
|
|
3
|
+
export { fastifyRouter, expressRouter };
|