diff --git a/apps/api/src/controllers/job_controller.ts b/apps/api/src/controllers/job_controller.ts index f768de6..0d18322 100644 --- a/apps/api/src/controllers/job_controller.ts +++ b/apps/api/src/controllers/job_controller.ts @@ -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 diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index efa32fd..95ae3af 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -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() diff --git a/apps/api/src/routes/job_route.ts b/apps/api/src/routes/job_route.ts index cf9f494..7295271 100644 --- a/apps/api/src/routes/job_route.ts +++ b/apps/api/src/routes/job_route.ts @@ -5,7 +5,7 @@ import { get_jobs, post_job, update_job, -} from '../controllers/job_controller' +} from '@controllers/job_controller' const router = express.Router() @@ -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 diff --git a/apps/api/src/server.ts b/apps/api/src/server.ts index c290850..62bd43b 100644 --- a/apps/api/src/server.ts +++ b/apps/api/src/server.ts @@ -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() diff --git a/apps/api/tsconfig.json b/apps/api/tsconfig.json index 10a4f1a..84e4f60 100644 --- a/apps/api/tsconfig.json +++ b/apps/api/tsconfig.json @@ -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": ["."], }