fixed file imports and added file with extension for imports
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
"migrate": "node-pg-migrate -m ./src/migrations",
|
"migrate": "node-pg-migrate -m ./src/migrations",
|
||||||
"test": "jest --forceExit"
|
"test": "jest --forceExit"
|
||||||
},
|
},
|
||||||
"type": "module",
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"express",
|
"express",
|
||||||
"node.js",
|
"node.js",
|
||||||
|
|||||||
+9
-9
@@ -1,15 +1,15 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import cors from 'cors'
|
import cors from 'cors'
|
||||||
import healthCheckRoutes from './routes/healthcheck'
|
import healthCheckRoutes from './routes/healthcheck/index.js'
|
||||||
import authRoutes from './routes/auth'
|
import authRoutes from './routes/auth/index.js'
|
||||||
import userRoutes from './routes/users'
|
import userRoutes from './routes/users/index.js'
|
||||||
import roleRoutes from './routes/roles'
|
import roleRoutes from './routes/roles/index.js'
|
||||||
import locationRoutes from './routes/locations'
|
import locationRoutes from './routes/locations/index.js'
|
||||||
import imageRoutes from './routes/images'
|
import imageRoutes from './routes/images/index.js'
|
||||||
import collectionRoutes from './routes/collections'
|
import collectionRoutes from './routes/collections/index.js'
|
||||||
import setRoutes from './routes/sets'
|
import setRoutes from './routes/sets/index.js'
|
||||||
import itemRoutes from './routes/items'
|
import itemRoutes from './routes/items/index.js'
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
const port = process.env.PORT || 3000
|
const port = process.env.PORT || 3000
|
||||||
|
|||||||
+5
-6
@@ -1,13 +1,12 @@
|
|||||||
// config/index.js
|
// config/index.js
|
||||||
export default {
|
export const database = {
|
||||||
database: {
|
|
||||||
host: process.env.DB_HOST || 'localhost',
|
host: process.env.DB_HOST || 'localhost',
|
||||||
user: process.env.DB_USER || 'your_db_user',
|
user: process.env.DB_USER || 'your_db_user',
|
||||||
password: process.env.DB_PASSWORD || 'your_db_password',
|
password: process.env.DB_PASSWORD || 'your_db_password',
|
||||||
database: process.env.DB_NAME || 'your_db_name',
|
database: process.env.DB_NAME || 'your_db_name',
|
||||||
port: process.env.DB_PORT || 5432,
|
port: process.env.DB_PORT || 5432,
|
||||||
},
|
}
|
||||||
jwtEnv: {
|
|
||||||
secret: process.env.JWT_SECRET || '',
|
export const jwtEnv = {
|
||||||
},
|
secret: process.env.JWT_SECRET || '',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
import bcrypt from 'bcryptjs'
|
import bcrypt from 'bcryptjs'
|
||||||
import { database, jwtEnv } from '../../config'
|
import { database, jwtEnv } from '../../config/index.js'
|
||||||
|
import { Pool } from 'pg'
|
||||||
const { Pool } = require('pg')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { Pool } from 'pg'
|
import { Pool } from 'pg'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { check, validationResult } from 'express-validator'
|
||||||
const { check, validationResult } = require('express-validator')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { Pool } from 'pg'
|
import { Pool } from 'pg'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { check, validationResult } from 'express-validator'
|
||||||
const { check, validationResult } = require('express-validator')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { Pool } from 'pg'
|
import { Pool } from 'pg'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { check, validationResult } from 'express-validator'
|
||||||
const { check, validationResult } = require('express-validator')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { Pool } from 'pg'
|
import { Pool } from 'pg'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { check, validationResult } from 'express-validator'
|
||||||
const { check, validationResult } = require('express-validator')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { Pool } from 'pg'
|
||||||
const { Pool } = require('pg')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { Pool } from 'pg'
|
import { Pool } from 'pg'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { check, validationResult } from 'express-validator'
|
||||||
const { check, validationResult } = require('express-validator')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { database } from '../../config'
|
import { database } from '../../config/index.js'
|
||||||
|
import { Pool } from 'pg'
|
||||||
const { Pool } = require('pg')
|
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user