summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-01 13:54:12 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-01 13:54:12 +0200
commitbbeab4da65c245cb6083554a44fa12293902424d (patch)
treed964467f79a2abe45eeacd9dd35d9d2670ce99ff /src/Server.ts
parent:sparkles: Channel get Route (diff)
downloadserver-ts-bbeab4da65c245cb6083554a44fa12293902424d.tar.xz
:art: added optional captcha to login route
Diffstat (limited to 'src/Server.ts')
-rw-r--r--src/Server.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Server.ts b/src/Server.ts

index c7f36233..f17d4c9d 100644 --- a/src/Server.ts +++ b/src/Server.ts
@@ -2,7 +2,7 @@ import "missing-native-js-functions"; import fs from "fs/promises"; import { Connection } from "mongoose"; import { Server, ServerOptions } from "lambert-server"; -import { Authentication, GlobalRateLimit } from "./middlewares/"; +import { Authentication, CORS, GlobalRateLimit } from "./middlewares/"; import Config from "./util/Config"; import { db } from "@fosscord/server-util"; import i18next from "i18next"; @@ -15,10 +15,9 @@ import fetch from "node-fetch"; import mongoose from "mongoose"; // this will return the new updated document for findOneAndUpdate -mongoose.set('returnOriginal', false); // https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndUpdate +mongoose.set("returnOriginal", false); // https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndUpdate - -export interface FosscordServerOptions extends ServerOptions { } +export interface FosscordServerOptions extends ServerOptions {} declare global { namespace Express { @@ -56,6 +55,7 @@ export class FosscordServer extends Server { this.app.use(GlobalRateLimit); this.app.use(Authentication); + this.app.use(CORS); this.app.use(BodyParser({ inflate: true })); const languages = await fs.readdir(__dirname + "/../locales/"); const namespaces = await fs.readdir(__dirname + "/../locales/en/");