@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsetsoft/ryunixjs",
3
- "version": "0.2.37-nightly.13",
3
+ "version": "0.2.37-nightly.15",
4
4
  "license": "MIT",
5
5
  "main": "./dist/Ryunix.js",
6
6
  "private": false,
@@ -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
@@ -1,5 +1,4 @@
1
1
  import Ryunix from "./lib/index.js";
2
- import Server from "./server/index.js";
3
2
  export {
4
3
  useStore,
5
4
  useEffect,
@@ -12,5 +11,4 @@ export {
12
11
 
13
12
  window.Ryunix = Ryunix;
14
13
 
15
- export { Server };
16
14
  export default Ryunix;
@@ -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
  };
@@ -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 };