mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge, problem_settings, problem_upload
This commit is contained in:
1 parent
5b4f5b6520
commit
b3024bebb0
45 files changed
+598
-250
No files matched your search
@@ -10,6 +10,7 @@ let db = null;
|
||||
Mongo.MongoClient.connect(mongourl, { useNewUrlParser: true, useUnifiedTopology: true })
|
||||
.then(Database => {
|
||||
db = Database.db(options.db.name);
|
||||
db.Db = Database;
|
||||
global.bus.emit('connected');
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
const
|
||||
{ GridFSBucket } = require('mongodb'),
|
||||
db = require('./db');
|
||||
if (!db.s) db.s = {};
|
||||
module.exports = new GridFSBucket(db);
|
||||
@@ -12,7 +12,12 @@ let app = new Koa();
|
||||
let server = http.createServer(app.callback());
|
||||
app.keys = options.session.keys;
|
||||
app.use(morgan(':method :url :status :res[content-length] - :response-time ms'));
|
||||
app.use(Body());
|
||||
app.use(Body({
|
||||
multipart: true,
|
||||
formidable: {
|
||||
maxFileSize: 256 * 1024 * 1024
|
||||
}
|
||||
}));
|
||||
let router = new Router();
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user