@unsetsoft/ryunixjs 0.2.37-nightly.13 → 0.2.37-nightly.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/package.json +1 -1
- package/server/index.js +18 -0
- package/src/main.js +0 -2
- package/webpack.config.mjs +0 -2
- package/src/server/index.js +0 -11
package/package.json
CHANGED
package/server/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import express, { Router } from "express";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
const app = express();
|
|
4
|
+
const api = Router();
|
|
5
|
+
import config from "../utils/config.cjs";
|
|
6
|
+
app.use(express.json());
|
|
7
|
+
app.use(express.static(`../${config.buildDirectory}`));
|
|
8
|
+
app.use(express.urlencoded({ extended: true }));
|
|
9
|
+
|
|
10
|
+
const useCors = (config = {}) => app.use(cors(config));
|
|
11
|
+
const init = (port = 3001) =>
|
|
12
|
+
app.listen(port, () => {
|
|
13
|
+
console.log("Server is runing at: https://localhost:" + port);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
app.use("/api/", api);
|
|
17
|
+
|
|
18
|
+
export { useCors, api, init };
|
package/src/main.js
CHANGED
package/webpack.config.mjs
CHANGED
|
@@ -35,7 +35,6 @@ export default {
|
|
|
35
35
|
devtoolModuleFilenameTemplate: "ryunix/[resource-path]",
|
|
36
36
|
clean: true,
|
|
37
37
|
},
|
|
38
|
-
target: "node",
|
|
39
38
|
devServer: {
|
|
40
39
|
hot: true,
|
|
41
40
|
historyApiFallback: {
|
|
@@ -136,6 +135,5 @@ export default {
|
|
|
136
135
|
],
|
|
137
136
|
externals: {
|
|
138
137
|
ryunix: "Ryunix",
|
|
139
|
-
express: { commonjs: "express" },
|
|
140
138
|
},
|
|
141
139
|
};
|
package/src/server/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import cors from "cors";
|
|
3
|
-
const route = express();
|
|
4
|
-
|
|
5
|
-
const useCors = (config = {}) => app.use(cors(config));
|
|
6
|
-
const init = (port) =>
|
|
7
|
-
route.listen(port, () => {
|
|
8
|
-
console.log("Server is runing at: https://localhost:" + port);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export default { useCors, route, init };
|