Merge remote-tracking branch 'origin/main'
# Conflicts: # api/main.ts # src/App.vue # src/router/index.ts
This commit is contained in:
12
api/main.ts
12
api/main.ts
@@ -1,4 +1,11 @@
|
|||||||
// main API file. Handles all the routing/api stuff
|
// main API file. Handles all the routing/api stuff
|
||||||
|
|
||||||
|
// Due to the Language servers, the import statements are
|
||||||
|
// shown as errors, @ts-ignore is used to ignore them.
|
||||||
|
// This is a Deno file, but the Vue LSP is still
|
||||||
|
// attempting to find errors, which causes
|
||||||
|
// confusing False errors
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { Router, Application } from "https://deno.land/x/oak/mod.ts";
|
import { Router, Application } from "https://deno.land/x/oak/mod.ts";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -8,12 +15,12 @@ import { oakCors } from "https://deno.land/x/cors/mod.ts";
|
|||||||
const router = new Router();
|
const router = new Router();
|
||||||
const app = new Application();
|
const app = new Application();
|
||||||
|
|
||||||
// Creates the routes for the API server.S
|
// Creates the routes for the API server.
|
||||||
// Example: localhost:8000/api will show "testAPIPoint"
|
// Example: localhost:8000/api will show "testAPIPoint"
|
||||||
// in the HTML
|
// in the HTML
|
||||||
router
|
router
|
||||||
.get("/", (ctx) => {
|
.get("/", (ctx) => {
|
||||||
ctx.response.body = "ESP Api";
|
ctx.response.body = "ESP API Site";
|
||||||
})
|
})
|
||||||
|
|
||||||
.get("/api", (ctx) => {
|
.get("/api", (ctx) => {
|
||||||
@@ -25,4 +32,5 @@ app.use(oakCors());
|
|||||||
app.use(router.routes());
|
app.use(router.routes());
|
||||||
app.use(router.allowedMethods());
|
app.use(router.allowedMethods());
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
await app.listen({ port: 8000 });
|
await app.listen({ port: 8000 });
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Sidebar from "./components/home_components/navigationbar.vue";
|
import Sidebar from "./components/home_components/sidebar.vue";
|
||||||
import NiceThings from "./components/home_components/trending.vue";
|
import NiceThings from "./components/home_components/interesting-hashtags.vue";
|
||||||
import Feed from "./components/home_components/feed.vue";
|
import Feed from "./components/home_components/feed.vue";
|
||||||
import Contacts from "./components/home_components/contacts.vue";
|
import Contacts from "./components/home_components/contacts.vue";
|
||||||
import Legal from "./components/home_components/legal.vue";
|
import Legal from "./components/home_components/legal.vue";
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import { createRouter, createWebHistory } from "vue-router";
|
import { createRouter, createWebHistory } from "vue-router";
|
||||||
|
|
||||||
|
// Vue components imported here.
|
||||||
|
// the vue components are the Pages that will be rendered
|
||||||
|
// at these URL's.
|
||||||
import Home from "../components/Home.vue";
|
import Home from "../components/Home.vue";
|
||||||
import Login from "../components/Login.vue";
|
import Login from "../components/Login.vue";
|
||||||
|
|
||||||
|
// The routing does not happen automatically
|
||||||
|
// Each route has to be defined here, or it wont work.
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -21,26 +27,3 @@ const router = createRouter({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
||||||
/*
|
|
||||||
<script setup lang="ts">
|
|
||||||
import Sidebar from "../src/components/navigationbar.vue";
|
|
||||||
import NiceThings from "../src/components/trending.vue";
|
|
||||||
import Feed from "../src/components/feed.vue";
|
|
||||||
import Contacts from "../src/components/contacts.vue";
|
|
||||||
import Legal from "../src/components/legal.vue";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div id="main" class="bg-weiss flex p-2">
|
|
||||||
<Sidebar></Sidebar>
|
|
||||||
<nice-things></nice-things>
|
|
||||||
<feed></feed>
|
|
||||||
<div class="w-1/4">
|
|
||||||
<contacts></contacts>
|
|
||||||
<legal></legal>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
*/
|
|
||||||
Reference in New Issue
Block a user