Re-moved webroot to src/main/resources
This commit is contained in:
@@ -13,24 +13,27 @@ public class HttpServerVerticle extends AbstractVerticle {
|
|||||||
Constants.LOGGER.info("🟢 Iniciando HttpServerVerticle...");
|
Constants.LOGGER.info("🟢 Iniciando HttpServerVerticle...");
|
||||||
|
|
||||||
Router router = Router.router(vertx);
|
Router router = Router.router(vertx);
|
||||||
|
|
||||||
router.route("/*").handler(StaticHandler.create(Constants.BASE_DIR + "/webroot")
|
router.route("/*")
|
||||||
.setDefaultContentEncoding("UTF-8"));
|
.handler(
|
||||||
|
StaticHandler.create("webroot")
|
||||||
|
.setDefaultContentEncoding("UTF-8")
|
||||||
|
);
|
||||||
|
|
||||||
router.route("/dashboard/*").handler(ctx -> {
|
router.route("/dashboard/*").handler(ctx -> {
|
||||||
ctx.reroute("/index.html");
|
ctx.reroute("/index.html");
|
||||||
});
|
});
|
||||||
|
|
||||||
vertx.createHttpServer().requestHandler(router).listen(
|
vertx.createHttpServer().requestHandler(router).listen(
|
||||||
Host.getWebserverPort(), Host.getHost(), result -> {
|
Host.getWebserverPort(), Host.getHost(), result -> {
|
||||||
if (result.succeeded()) {
|
if (result.succeeded()) {
|
||||||
Constants.LOGGER.info(String.format("📡 HttpServerVerticle desplegado. (http://%s:%d)",
|
Constants.LOGGER.info(String.format("📡 HttpServerVerticle desplegado. (http://%s:%d)",
|
||||||
Host.getHost(), Host.getWebserverPort())
|
Host.getHost(), Host.getWebserverPort())
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Constants.LOGGER.error("❌ Error al desplegar HttpServerVerticle", result.cause());
|
Constants.LOGGER.error("❌ Error al desplegar HttpServerVerticle", result.cause());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
612
backend/src/main/resources/webroot/assets/index-ByqS16T9.js
Normal file
612
backend/src/main/resources/webroot/assets/index-ByqS16T9.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
17
backend/src/main/resources/webroot/assets/react-vendors-DbHEDQBy.js
vendored
Normal file
17
backend/src/main/resources/webroot/assets/react-vendors-DbHEDQBy.js
vendored
Normal file
File diff suppressed because one or more lines are too long
97
backend/src/main/resources/webroot/config/settings.json
Normal file
97
backend/src/main/resources/webroot/config/settings.json
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
"userConfig": {
|
||||||
|
"city": [
|
||||||
|
37.38283,
|
||||||
|
-5.97317
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"appConfig": {
|
||||||
|
"endpoints": {
|
||||||
|
"BASE_URL": "http://localhost:8081/api/v1",
|
||||||
|
"GET_GROUPS": "/groups",
|
||||||
|
"GET_GROUP_BY_ID": "/groups/{0}",
|
||||||
|
"GET_GROUP_DEVICES": "/groups/{0}/devices",
|
||||||
|
"POST_GROUPS": "/groups",
|
||||||
|
"PUT_GROUP_BY_ID": "/groups/{0}",
|
||||||
|
"GET_DEVICES": "/devices",
|
||||||
|
"GET_DEVICE_BY_ID": "/devices/{0}",
|
||||||
|
"GET_DEVICE_SENSORS": "/devices/{0}/sensors",
|
||||||
|
"GET_DEVICE_LATEST_VALUES": "/devices/{0}/latest",
|
||||||
|
"GET_DEVICE_POLLUTION_MAP": "/devices/{0}/pollution-map",
|
||||||
|
"GET_DEVICE_HISTORY": "/devices/{0}/history",
|
||||||
|
"POST_DEVICES": "/devices",
|
||||||
|
"PUT_DEVICE_BY_ID": "/devices/{0}",
|
||||||
|
"GET_SENSORS": "/sensors",
|
||||||
|
"GET_SENSOR_BY_ID": "/sensors/{0}",
|
||||||
|
"GET_SENSOR_VALUES": "/sensors/{0}/values",
|
||||||
|
"POST_SENSORS": "/sensors",
|
||||||
|
"PUT_SENSOR_BY_ID": "/sensors/{0}",
|
||||||
|
"GET_ACTUATORS": "/actuators",
|
||||||
|
"GET_ACTUATOR_BY_ID": "/actuators/{0}",
|
||||||
|
"POST_ACTUATORS": "/actuators",
|
||||||
|
"PUT_ACTUATOR_BY_ID": "/actuators/{0}",
|
||||||
|
"GET_GPS_VALUES": "/gps-values",
|
||||||
|
"GET_GPS_VALUE_BY_ID": "/gps-values/{0}",
|
||||||
|
"POST_GPS_VALUES": "/gps-values",
|
||||||
|
"GET_AIR_VALUES": "/air-values",
|
||||||
|
"GET_AIR_VALUE_BY_ID": "/air-values/{0}",
|
||||||
|
"POST_AIR_VALUES": "/air-values"
|
||||||
|
},
|
||||||
|
"historyChartConfig": {
|
||||||
|
"chartOptionsDark": {
|
||||||
|
"responsive": true,
|
||||||
|
"maintainAspectRatio": false,
|
||||||
|
"scales": {
|
||||||
|
"x": {
|
||||||
|
"grid": {
|
||||||
|
"color": "rgba(255, 255, 255, 0.1)"
|
||||||
|
},
|
||||||
|
"ticks": {
|
||||||
|
"color": "#E0E0E0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"grid": {
|
||||||
|
"color": "rgba(255, 255, 255, 0.1)"
|
||||||
|
},
|
||||||
|
"ticks": {
|
||||||
|
"color": "#E0E0E0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"legend": {
|
||||||
|
"display": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chartOptionsLight": {
|
||||||
|
"responsive": true,
|
||||||
|
"maintainAspectRatio": false,
|
||||||
|
"scales": {
|
||||||
|
"x": {
|
||||||
|
"grid": {
|
||||||
|
"color": "rgba(0, 0, 0, 0.1)"
|
||||||
|
},
|
||||||
|
"ticks": {
|
||||||
|
"color": "#333"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"grid": {
|
||||||
|
"color": "rgba(0, 0, 0, 0.1)"
|
||||||
|
},
|
||||||
|
"ticks": {
|
||||||
|
"color": "#333"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"legend": {
|
||||||
|
"display": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
backend/src/main/resources/webroot/images/favicon.ico
Normal file
BIN
backend/src/main/resources/webroot/images/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
backend/src/main/resources/webroot/images/logo.png
Normal file
BIN
backend/src/main/resources/webroot/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 412 KiB |
27
backend/src/main/resources/webroot/index.html
Normal file
27
backend/src/main/resources/webroot/index.html
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="es">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta property="og:title" content="ContaminUS" />
|
||||||
|
<meta property="og:description" content="Midiendo la calidad del aire y las calles en Sevilla 🌿🚛" />
|
||||||
|
<meta property="og:image" content="https://contaminus.miarma.net/logo.png" />
|
||||||
|
<meta property="og:url" content="https://contaminus.miarma.net/" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:locale" content="es_ES" />
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
<meta name="twitter:title" content="ContaminUS" />
|
||||||
|
<meta name="twitter:description" content="Midiendo la calidad del aire y las calles en Sevilla 🌿🚛" />
|
||||||
|
<meta name="twitter:image" content="https://contaminus.miarma.net/logo.png" />
|
||||||
|
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
|
||||||
|
<title>ContaminUS</title>
|
||||||
|
<script type="module" crossorigin src="/assets/index-ByqS16T9.js"></script>
|
||||||
|
<link rel="modulepreload" crossorigin href="/assets/react-vendors-DbHEDQBy.js">
|
||||||
|
<link rel="modulepreload" crossorigin href="/assets/leaflet-DYDK0jU3.js">
|
||||||
|
<link rel="modulepreload" crossorigin href="/assets/chartjs-C6LAl0aW.js">
|
||||||
|
<link rel="stylesheet" crossorigin href="/assets/index-lEmLSKa6.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
57
frontend/package-lock.json
generated
57
frontend/package-lock.json
generated
@@ -32,7 +32,8 @@
|
|||||||
"eslint-plugin-react-hooks": "^5.0.0",
|
"eslint-plugin-react-hooks": "^5.0.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.18",
|
"eslint-plugin-react-refresh": "^0.4.18",
|
||||||
"globals": "^15.14.0",
|
"globals": "^15.14.0",
|
||||||
"vite": "^6.2.0"
|
"vite": "^6.2.0",
|
||||||
|
"vite-plugin-clean": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
@@ -1114,6 +1115,29 @@
|
|||||||
"react-dom": "^19.0.0"
|
"react-dom": "^19.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@rollup/pluginutils": {
|
||||||
|
"version": "5.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz",
|
||||||
|
"integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/estree": "^1.0.0",
|
||||||
|
"estree-walker": "^2.0.2",
|
||||||
|
"picomatch": "^4.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"rollup": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||||
"version": "4.34.8",
|
"version": "4.34.8",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz",
|
||||||
@@ -2543,6 +2567,13 @@
|
|||||||
"node": ">=4.0"
|
"node": ">=4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/estree-walker": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/esutils": {
|
"node_modules/esutils": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||||
@@ -3807,6 +3838,19 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/picomatch": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/possible-typed-array-names": {
|
"node_modules/possible-typed-array-names": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
||||||
@@ -4690,6 +4734,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vite-plugin-clean": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/vite-plugin-clean/-/vite-plugin-clean-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-I0pQDsY+VlqbKeR51v01fhujn+LSVnLS3a/6mcqVMCwuC5ZGBtR+wj3SxekaNpzsTwKfbkGbqoyHKn/CUEhg5w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@rollup/pluginutils": "^5.1.4",
|
||||||
|
"vite": "^6.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
|||||||
@@ -5,10 +5,9 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build --emptyOutDir",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview"
|
||||||
"deploy": "vite build && scp -r ./dist/* jomaa@192.168.1.200:/var/www/contaminus/"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
||||||
@@ -35,6 +34,7 @@
|
|||||||
"eslint-plugin-react-hooks": "^5.0.0",
|
"eslint-plugin-react-hooks": "^5.0.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.18",
|
"eslint-plugin-react-refresh": "^0.4.18",
|
||||||
"globals": "^15.14.0",
|
"globals": "^15.14.0",
|
||||||
"vite": "^6.2.0"
|
"vite": "^6.2.0",
|
||||||
|
"vite-plugin-clean": "^2.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
|
import cleanPlugin from 'vite-plugin-clean'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
port: 8080,
|
port: 8080,
|
||||||
},
|
},
|
||||||
plugins: [react()],
|
plugins: [react(), cleanPlugin()],
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
@@ -17,7 +18,7 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
outDir: 'dist',
|
outDir: '../backend/src/main/resources/webroot',
|
||||||
},
|
},
|
||||||
publicDir: 'public',
|
publicDir: 'public',
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user