fixed file imports and added file with extension for imports (#9)

Reviewed-on: #9
Co-authored-by: Joseph Nelson <joseph.nelson4456@gmail.com>
Co-committed-by: Joseph Nelson <joseph.nelson4456@gmail.com>
This commit was merged in pull request #9.
This commit is contained in:
2026-05-17 23:25:42 -07:00
committed by joseph.nelson4456
parent de6d8cd8fe
commit e352a26c66
11 changed files with 35 additions and 45 deletions
-1
View File
@@ -11,7 +11,6 @@
"migrate": "node-pg-migrate -m ./src/migrations",
"test": "jest --forceExit"
},
"type": "module",
"keywords": [
"express",
"node.js",
+9 -9
View File
@@ -1,15 +1,15 @@
import express from 'express'
import path from 'path'
import cors from 'cors'
import healthCheckRoutes from './routes/healthcheck'
import authRoutes from './routes/auth'
import userRoutes from './routes/users'
import roleRoutes from './routes/roles'
import locationRoutes from './routes/locations'
import imageRoutes from './routes/images'
import collectionRoutes from './routes/collections'
import setRoutes from './routes/sets'
import itemRoutes from './routes/items'
import healthCheckRoutes from './routes/healthcheck/index.js'
import authRoutes from './routes/auth/index.js'
import userRoutes from './routes/users/index.js'
import roleRoutes from './routes/roles/index.js'
import locationRoutes from './routes/locations/index.js'
import imageRoutes from './routes/images/index.js'
import collectionRoutes from './routes/collections/index.js'
import setRoutes from './routes/sets/index.js'
import itemRoutes from './routes/items/index.js'
const app = express()
const port = process.env.PORT || 3000
+5 -6
View File
@@ -1,13 +1,12 @@
// config/index.js
export default {
database: {
export const database = {
host: process.env.DB_HOST || 'localhost',
user: process.env.DB_USER || 'your_db_user',
password: process.env.DB_PASSWORD || 'your_db_password',
database: process.env.DB_NAME || 'your_db_name',
port: process.env.DB_PORT || 5432,
},
jwtEnv: {
secret: process.env.JWT_SECRET || '',
},
}
export const jwtEnv = {
secret: process.env.JWT_SECRET || '',
}
+2 -3
View File
@@ -1,9 +1,8 @@
import express from 'express'
import jwt from 'jsonwebtoken'
import bcrypt from 'bcryptjs'
import { database, jwtEnv } from '../../config'
const { Pool } = require('pg')
import { database, jwtEnv } from '../../config/index.js'
import { Pool } from 'pg'
const router = express.Router()
+2 -3
View File
@@ -1,8 +1,7 @@
import express from 'express'
import { Pool } from 'pg'
import { database } from '../../config'
const { check, validationResult } = require('express-validator')
import { database } from '../../config/index.js'
import { check, validationResult } from 'express-validator'
const router = express.Router()
+2 -3
View File
@@ -1,8 +1,7 @@
import express from 'express'
import { Pool } from 'pg'
import { database } from '../../config'
const { check, validationResult } = require('express-validator')
import { database } from '../../config/index.js'
import { check, validationResult } from 'express-validator'
const router = express.Router()
+2 -3
View File
@@ -1,8 +1,7 @@
import express from 'express'
import { Pool } from 'pg'
import { database } from '../../config'
const { check, validationResult } = require('express-validator')
import { database } from '../../config/index.js'
import { check, validationResult } from 'express-validator'
const router = express.Router()
+2 -3
View File
@@ -1,8 +1,7 @@
import express from 'express'
import { Pool } from 'pg'
import { database } from '../../config'
const { check, validationResult } = require('express-validator')
import { database } from '../../config/index.js'
import { check, validationResult } from 'express-validator'
const router = express.Router()
+2 -3
View File
@@ -1,7 +1,6 @@
import express from 'express'
import { database } from '../../config'
const { Pool } = require('pg')
import { database } from '../../config/index.js'
import { Pool } from 'pg'
const router = express.Router()
+2 -3
View File
@@ -1,8 +1,7 @@
import express from 'express'
import { Pool } from 'pg'
import { database } from '../../config'
const { check, validationResult } = require('express-validator')
import { database } from '../../config/index.js'
import { check, validationResult } from 'express-validator'
const router = express.Router()
+2 -3
View File
@@ -1,7 +1,6 @@
import express from 'express'
import { database } from '../../config'
const { Pool } = require('pg')
import { database } from '../../config/index.js'
import { Pool } from 'pg'
const router = express.Router()