Skip to content

Commit

Permalink
refactor: add absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hariscs committed Feb 24, 2024
1 parent 861fa38 commit 24bc5e6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/controllers/job_controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from 'express'
import { JOB_SCHEMA } from '../models/job_model'
import { JOB_SCHEMA } from '@models/job_model'
import { isValidObjectId } from 'mongoose'

//* @desc Get all jobs
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { log } from '@repo/logger'
import { createServer } from './server'
import job_route from './routes/job_route'
import job_route from '@routes/job_route'

const port = process.env.PORT || 5001
const server = createServer()
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/routes/job_route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
get_jobs,
post_job,
update_job,
} from '../controllers/job_controller'
} from '@controllers/job_controller'

const router = express.Router()

Expand All @@ -19,7 +19,7 @@ router.get('/:id', get_job)

//* @desc Post job
//! @access Private
router.post('/job', post_job)
router.post('/', post_job)

//* @desc Delete job
//! @access Private
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import express, { type Express } from 'express'
import morgan from 'morgan'
import cors from 'cors'
import { config } from 'dotenv'
import { connect_db } from '../config/db'
import { connect_db } from '@config/db'

config()
connect_db()
Expand Down
11 changes: 10 additions & 1 deletion apps/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
"lib": ["ES2015"],
"module": "CommonJS",
"outDir": "./dist",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@lib/*": ["src/lib/*"],
"@controllers/*": ["src/controllers/*"],
"@models/*": ["src/models/*"],
"@config/*": ["config/*"],
"@routes/*": ["src/routes/*"],
},
},
"exclude": ["node_modules"],
"include": ["."]
"include": ["."],
}

0 comments on commit 24bc5e6

Please sign in to comment.