Skip to content

Commit

Permalink
imported routes in index.ts and changed package.json script
Browse files Browse the repository at this point in the history
  • Loading branch information
mohakvni committed Feb 5, 2024
1 parent d79c706 commit 47d6db6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/index.js → backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
const express = require("express");

Check failure on line 1 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe assignment of an `any` value

Check failure on line 1 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Require statement not part of import statement

Check warning on line 1 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

There should be at least one empty line between import groups
const fileRoutes = require('./src/routes/fileRoutes.ts')

Check failure on line 2 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe assignment of an `any` value

Check failure on line 2 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Require statement not part of import statement

const PORT = process.env.PORT || 3001;

Check failure on line 4 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator

const app = express();

Check failure on line 6 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe assignment of an `any` value

Check failure on line 6 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe call of an `any` typed value

app.use(express.json());

Check failure on line 8 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe call of an `any` typed value

Check failure on line 8 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe member access .use on an `any` value

Check failure on line 8 in backend/index.ts

View workflow job for this annotation

GitHub Actions / Backend lint and style check

Unsafe call of an `any` typed value

app.use("/file", fileRoutes);

app.listen(PORT, () => {
console.log(`Server listening on ${PORT}`);
});
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Backend for CCIDC Application Overhaul",
"main": "index.js",
"scripts": {
"start": "node index.js",
"start": "ts-node index.ts",
"format": "npm run check-git-hooks && prettier --write .",
"lint-fix": "npm run check-git-hooks && (eslint --fix --cache --report-unused-disable-directives . || true) && prettier --write .",
"lint-check": "npm run check-git-hooks && eslint --cache --report-unused-disable-directives . && prettier --check .",
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/fileRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ router.delete("/delete/:id", (req: Request<DeleteParams>, res: Response) => {});
// PATCH method to update file by ID
router.patch("/update/:id", (req: Request<UpdateParams>, res: Response) => {});

export default router;
module.exports = router;

0 comments on commit 47d6db6

Please sign in to comment.