This commit is contained in:
srgooglo 2022-05-06 14:18:35 +02:00
parent 06061048e0
commit b515eb24f9
5 changed files with 9 additions and 9 deletions

View File

@ -12,7 +12,7 @@ const serverManifest = {
get: (key) => { get: (key) => {
let data = {} let data = {}
if (fs.existsSync(SERVER_MANIFEST)) { if (fs.existsSync(SERVER_MANIFEST)) {
data = JSON.parse(fs.readFileSync(SERVER_MANIFEST_PATH, 'utf8')) data = JSON.parse(fs.readFileSync(SERVER_MANIFEST_PATH, "utf8"))
} }
if (typeof key === "string") { if (typeof key === "string") {

View File

@ -1,5 +1,5 @@
const path = require('path') const path = require("path")
const fs = require('fs') const fs = require("fs")
// TODO: Volatile files // TODO: Volatile files
// TODO: Redis cache // TODO: Redis cache
@ -7,10 +7,10 @@ const fs = require('fs')
class FilesystemDriver { class FilesystemDriver {
constructor(params) { constructor(params) {
this.params = { ...params } this.params = { ...params }
this.rootPath = this.params.root ?? path.resolve(process.cwd(), 'storage') this.rootPath = this.params.root ?? path.resolve(process.cwd(), "storage")
this.defaultWriteMode = "0777" this.defaultWriteMode = "0777"
this.defaultWriteFlags = 'w+' this.defaultWriteFlags = "w+"
this.strictMimetypeCheck = this.strictMimetypeCheck ?? false this.strictMimetypeCheck = this.strictMimetypeCheck ?? false
this.checkMimetypes = this.params.checkMimetypes ?? false this.checkMimetypes = this.params.checkMimetypes ?? false

View File

@ -1,3 +1,3 @@
const path = require('path') const path = require("path")
const fs = require('fs') const fs = require("fs")

View File

@ -1,4 +1,4 @@
const path = require('path') const path = require("path")
const drivers = { const drivers = {
"fs": require("./drivers/filesystem"), "fs": require("./drivers/filesystem"),

View File

@ -25,7 +25,7 @@ global.DEFAULT_SERVER_PARAMS = {
} }
global.DEFAULT_MIDDLEWARES = [ global.DEFAULT_MIDDLEWARES = [
require('cors')({ require("cors")({
"origin": "*", "origin": "*",
"methods": DEFAULT_HEADERS["Access-Control-Allow-Methods"], "methods": DEFAULT_HEADERS["Access-Control-Allow-Methods"],
"preflightContinue": false, "preflightContinue": false,