refactor: standardize paths in require()'s

This commit is contained in:
Bobby Wibowo 2022-07-12 08:51:22 +07:00
parent 79631ce624
commit a356ce5ad3
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
8 changed files with 16 additions and 16 deletions

View File

@ -2,8 +2,8 @@ const path = require('path')
const paths = require('./pathsController')
const ClientError = require('./utils/ClientError')
const ServerError = require('./utils/ServerError')
const config = require('../config')
const logger = require('../logger')
const config = require('./../config')
const logger = require('./../logger')
const self = {
errorPagesCodes: Object.keys(config.errorPages)

View File

@ -1,9 +1,9 @@
const contentDisposition = require('content-disposition')
const SimpleDataStore = require('../utils/SimpleDataStore')
const paths = require('../pathsController')
const utils = require('../utilsController')
const logger = require('../../logger')
const SimpleDataStore = require('./../utils/SimpleDataStore')
const paths = require('./../pathsController')
const utils = require('./../utilsController')
const logger = require('./../../logger')
class ServeStatic {
directory

View File

@ -1,7 +1,7 @@
const { Router } = require('hyper-express')
const routes = new Router()
const path = require('path')
const errors = require('../controllers/errorsController')
const errors = require('./../controllers/errorsController')
const utils = require('./../controllers/utilsController')
const config = require('./../config')

View File

@ -1,7 +1,7 @@
const { Router } = require('hyper-express')
const routes = new Router()
const utils = require('../controllers/utilsController')
const config = require('../config')
const utils = require('./../controllers/utilsController')
const config = require('./../config')
routes.get('/file/:identifier', async (req, res) => {
// Uploads identifiers parsing, etc., are strictly handled by client-side JS at src/js/file.js

View File

@ -1,6 +1,6 @@
const path = require('path')
const paths = require('../controllers/pathsController')
const utils = require('../controllers/utilsController')
const paths = require('./../controllers/pathsController')
const utils = require('./../controllers/utilsController')
const self = {
getFiles: async directory => {

View File

@ -1,4 +1,4 @@
const utils = require('../controllers/utilsController')
const utils = require('./../controllers/utilsController')
;(async () => {
const location = process.argv[1].replace(process.cwd() + '/', '')

View File

@ -1,8 +1,8 @@
const blake3 = require('blake3')
const fs = require('fs')
const path = require('path')
const paths = require('../controllers/pathsController')
const utils = require('../controllers/utilsController')
const paths = require('./../controllers/pathsController')
const utils = require('./../controllers/utilsController')
;(async () => {
const location = process.argv[1].replace(process.cwd() + '/', '')

View File

@ -1,6 +1,6 @@
const path = require('path')
const paths = require('../controllers/pathsController')
const utils = require('../controllers/utilsController')
const paths = require('./../controllers/pathsController')
const utils = require('./../controllers/utilsController')
const self = {
mode: null,