add bootstrap

pull/8/head
qwertyforce 2022-09-02 22:06:29 +03:00
parent d03e0b6eae
commit 574739e02b
3 changed files with 13 additions and 15 deletions

View File

@ -2,6 +2,7 @@
"name": "scenery",
"version": "2.0.0",
"scripts": {
"bootstrap": "node ./src/bootstrap/bootstrap.js",
"dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider nodemon",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider next build && tsc --project tsconfig.server.json",
"build_pages": "next build",

View File

@ -0,0 +1,12 @@
const fs = require("fs")
const path = require("path")
console.log(__dirname)
const root_path = path.join(__dirname, "..", "..")
const dirs = ["public", "temp", "import", path.join("import", "images"), path.join("public", "thumbnails"), path.join("public", "images")]
for (const dir of dirs) {
const dir_path = path.join(root_path, dir)
if (!fs.existsSync(dir_path)) {
fs.mkdirSync(dir_path);
}
}

View File

@ -16,21 +16,6 @@ declare module "fastify" {
}
}
////////////////////////////////////////////////////////INIT DEFAULT FOLDERS
import fs from 'fs'
import path from "path"
const root_path = path.join(__dirname, "..", "..")
const dirs = ["public", "temp", "import", path.join("import", "images"), path.join("public", "thumbnails"), path.join("public", "images")]
for (const dir of dirs) {
const dir_path = path.join(root_path, dir)
if (!fs.existsSync(dir_path)) {
fs.mkdirSync(dir_path);
}
}
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
const dev = process.env.NODE_ENV !== 'production'
const port = parseInt(process.env.NODE_PORT || config.server_port)