Merged some functions in database/utils.ts to attempt to shorten code length, Also changed tests to work with the new datatypes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/// <reference lib="deno.ns" />
|
||||
/**
|
||||
/**
|
||||
* @author Esad Mustafoski
|
||||
* @description Main API file, Handles all the routing/api stuff
|
||||
* Main API file, Handles all the routing/api stuff
|
||||
*/
|
||||
|
||||
// +++ IMPORTS ------------------------------------------------------ //
|
||||
@@ -9,12 +9,10 @@ import { Application, Router } from "https://deno.land/x/oak/mod.ts";
|
||||
import { oakCors } from "https://deno.land/x/cors/mod.ts";
|
||||
import * as db_utils from "../database/utils.ts";
|
||||
|
||||
|
||||
// +++ VARIABLES ---------------------------------------------------- //
|
||||
const router = new Router();
|
||||
const app = new Application();
|
||||
|
||||
|
||||
// +++ ROUTER ------------------------------------------------------- //
|
||||
// Creates the routes for the API server.
|
||||
// Example: localhost:8000/api will show "testAPIPoint"
|
||||
@@ -36,10 +34,9 @@ router
|
||||
ctx.response.body = { getPosts, countedPosts };
|
||||
});
|
||||
|
||||
|
||||
app.use(oakCors());
|
||||
app.use(router.routes());
|
||||
app.use(router.allowedMethods());
|
||||
|
||||
export { app };
|
||||
await app.listen({ port: 8000 });
|
||||
await app.listen({ port: 8000 });
|
||||
|
||||
Reference in New Issue
Block a user