Skip to content

Commit

Permalink
Moved backend files into src directory
Browse files Browse the repository at this point in the history
  • Loading branch information
vilnor committed May 2, 2024
1 parent 393956f commit 0da31c8
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ COPY ./package.json /app
COPY ./package-lock.json /app
RUN npm ci

COPY ./index.ts .
COPY ./db ./db
COPY ./routes ./routes
COPY ./src ./src

CMD ["npm", "run", "start"]
2 changes: 1 addition & 1 deletion backend/__tests__/backend.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { single_nest, nest } = require("../routes/routes");
const { single_nest, nest } = require("../src/routes/routes");

// All tests for the nest function
describe("nest function", () => {
Expand Down
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": "",
"main": "src/index.ts",
"scripts": {
"start": "ts-node index.ts",
"start": "ts-node src/index.ts",
"test": "jest"
},
"author": "",
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions backend/index.ts → backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
* Imports
*/
import express from "express";
import { Pool } from 'pg';
import cors from 'cors';

import { routes } from './routes/index';
import * as db from './db/index';
import { routes } from './routes';
import * as db from './db';

const PORT: number = process.env.PORT ? parseInt(process.env.PORT) : 8080;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/routes/routes.ts → backend/src/routes/routes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Imports
import { Router, Request, Response } from 'express'; // Import Request and Response types
import * as db from '../db/index';
import * as db from '../db';
import {
Comment as IComment,
CommentBodyParams,
Expand Down
File renamed without changes.

0 comments on commit 0da31c8

Please sign in to comment.