Skip to content

Commit

Permalink
add formating & linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Jul 18, 2024
1 parent 1ed8e56 commit 86c9521
Show file tree
Hide file tree
Showing 42 changed files with 1,749 additions and 1,501 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"start": "nodemon",
"inspect": "nodemon --inspect src/app.ts",
"test": "mocha --inspect=9229 -r ts-node/register tests/**/*.test.ts --require tests/root.ts --serial",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint --fix src/**/*.ts",
"format": "prettier --write src/**/*.ts",
"lint": "eslint '**/*.{js,ts,jsx,tsx}'",
"lint:fix": "eslint --fix '**/*.{js,ts,jsx,tsx}'",
"format": "prettier --write '**/*.{js,ts,jsx,tsx}'",
"prepare": "husky"
},
"husky": {
Expand Down
24 changes: 12 additions & 12 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Router } from 'express';

import {storageRoutes} from './routes/storageRoutes';
import {ExpressUtil} from "../utilz/expressUtil";

// guaranteed to get dependencies
export default () => {
const app = Router();
app.use(ExpressUtil.handle);
storageRoutes(app);
return app;
};
import { Router } from 'express'

import { ExpressUtil } from '../utilz/expressUtil'
import { storageRoutes } from './routes/storageRoutes'

// guaranteed to get dependencies
export default () => {
const app = Router()
app.use(ExpressUtil.handle)
storageRoutes(app)
return app
}
11 changes: 6 additions & 5 deletions src/api/middlewares/onlyLocalhost.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Container } from 'typedi'

import config from '../../config'

var dns = require('dns')
var os = require('os')
var ifaces = os.networkInterfaces()
const dns = require('dns')
const os = require('os')
const ifaces = os.networkInterfaces()

/**
* @param {*} req Express req Object
Expand All @@ -14,8 +15,8 @@ const onlyLocalhost = async (req, res, next) => {
const Logger = Container.get('logger')
try {
// Check if ip is localhost and only continue
var ip = req.connection.remoteAddress
var host = req.get('host')
const ip = req.connection.remoteAddress
const host = req.get('host')

if (config.environment === 'production') {
// Return with unauthorized error
Expand Down
Loading

0 comments on commit 86c9521

Please sign in to comment.