Initial commit

This commit is contained in:
2024-12-29 12:11:11 +01:00
parent 6e1e00d048
commit 856dfbd119
9 changed files with 105 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "client: chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "server: nuxt",
"outputCapture": "std",
"program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
"args": [
"dev"
],
}
],
"compounds": [
{
"name": "fullstack: nuxt",
"configurations": [
"server: nuxt",
"client: chrome"
]
}
]
}
+6
View File
@@ -0,0 +1,6 @@
{
"files.exclude": {
"**/.nuxt": true,
"**/node_modules": true
}
}
+6
View File
@@ -1,6 +1,12 @@
<script lang="ts">
import 'reflect-metadata';
</script>
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtWelcome />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>
+23
View File
@@ -0,0 +1,23 @@
const validPaths = ["/", "/rules", "/test"];
export default defineNuxtRouteMiddleware(async (to, from) => {
const config = useRuntimeConfig();
if (to.path == "/login") {
console.log("hey")
const code = to.query.code;
if (!code) {
navigateTo(config.public.discordLoginEndpoint, { external: true });
} else {
navigateTo("/login");
}
return
}
if (validPaths.includes(to.path)) {
return;
}
if (to.path !== "/") {
return navigateTo("/");
}
});
+15 -1
View File
@@ -1,5 +1,19 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true }
ssr: true,
devtools: { enabled: true },
runtimeConfig: {
public: {
endpoint: "https://playtest.legonzaur.fr/api", // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
discordLoginEndpoint: "",
devMode: false,
},
},
nitro: {
prerender: {
routes: ["/login", "/"],
crawlLinks: true,
},
},
})
+14
View File
@@ -7,7 +7,9 @@
"name": "nuxt-app",
"hasInstallScript": true,
"dependencies": {
"class-transformer": "^0.5.1",
"nuxt": "^3.15.0",
"reflect-metadata": "^0.2.2",
"vue": "latest",
"vue-router": "latest"
}
@@ -3404,6 +3406,12 @@
"consola": "^3.2.3"
}
},
"node_modules/class-transformer": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz",
"integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==",
"license": "MIT"
},
"node_modules/clipboardy": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-4.0.0.tgz",
@@ -7148,6 +7156,12 @@
"node": ">=4"
}
},
"node_modules/reflect-metadata": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",
"license": "Apache-2.0"
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+2
View File
@@ -10,7 +10,9 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"class-transformer": "^0.5.1",
"nuxt": "^3.15.0",
"reflect-metadata": "^0.2.2",
"vue": "latest",
"vue-router": "latest"
}
+3
View File
@@ -0,0 +1,3 @@
<template>
Hello
</template>
+3
View File
@@ -0,0 +1,3 @@
<template>
Hello
</template>