Change routes structure
- Rename home to HomeRoute - Rename upload to UploadRoute - Remove index.ts - Remove unused importspull/4/head
parent
e413e76321
commit
827ac1ff95
@ -1,14 +1,14 @@
|
|||||||
|
import * as crypto from "crypto";
|
||||||
import {Router} from "express";
|
import {Router} from "express";
|
||||||
|
import * as fileUpload from "express-fileupload";
|
||||||
import {UploadedFile} from "express-fileupload";
|
import {UploadedFile} from "express-fileupload";
|
||||||
import {User} from "../lib/models";
|
|
||||||
import Route from "../lib/Route";
|
|
||||||
import * as fsx from "fs-extra";
|
import * as fsx from "fs-extra";
|
||||||
import globals from "../lib/globals";
|
|
||||||
import * as path from "path";
|
|
||||||
import * as crypto from "crypto";
|
|
||||||
import * as fileUpload from "express-fileupload";
|
|
||||||
import * as status from "http-status";
|
import * as status from "http-status";
|
||||||
|
import * as path from "path";
|
||||||
import * as sharp from "sharp";
|
import * as sharp from "sharp";
|
||||||
|
import globals from "../lib/globals";
|
||||||
|
import {User} from "../lib/models";
|
||||||
|
import Route from "../lib/Route";
|
||||||
|
|
||||||
const dataDirName = "data";
|
const dataDirName = "data";
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* @author Trivernis
|
|
||||||
* @remarks
|
|
||||||
*
|
|
||||||
* Taken from {@link https://github.com/Trivernis/whooshy}
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {Router} from "express";
|
|
||||||
import {Server} from "socket.io";
|
|
||||||
|
|
||||||
import HomeRoute from "./home";
|
|
||||||
import {UploadRoute} from "./upload";
|
|
||||||
|
|
||||||
const homeRoute = new HomeRoute();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Namespace to manage the routes of the server.
|
|
||||||
* Allows easier assignments of graphql endpoints, socket.io connections and routers when
|
|
||||||
* used with {@link Route}.
|
|
||||||
*/
|
|
||||||
namespace routes {
|
|
||||||
export const router = Router();
|
|
||||||
|
|
||||||
router.use("/", homeRoute.router);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Assigns the io listeners or namespaces to the routes
|
|
||||||
* @param io
|
|
||||||
*/
|
|
||||||
export const ioListeners = async (io: Server) => {
|
|
||||||
await homeRoute.init(io);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default routes;
|
|
Loading…
Reference in New Issue