Skip to content

Commit

Permalink
Updated proc file and server name
Browse files Browse the repository at this point in the history
  • Loading branch information
AarshShah9 committed Jan 28, 2024
1 parent a265593 commit 3271332
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: cd backend && npm run start
web: backend/dist/backend
6 changes: 3 additions & 3 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "server.js",
"prisma": {
"seed": "ts-node prisma/seed.ts"
},
"scripts": {
"test": "jest --detectOpenHandles",
"clearJest": "jest --clearCache",
"dev": "concurrently \"tsc --watch\" \"nodemon -q dist/backend/index.js\"",
"dev": "concurrently \"tsc --watch\" \"nodemon -q dist/backend/server.js\"",
"build": "tsc",
"start": "node dist/backend/index.js"
"start": "node dist/backend/server.js"
},
"keywords": [],
"author": "",
Expand Down
File renamed without changes.
19 changes: 9 additions & 10 deletions backend/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// Write a jest test to hit the /Test Endpoint
import request from 'supertest';
import app, {server} from '../index';
import request from "supertest";
import app, { server } from "../server";


test('Intial Test', async () => {
const res = await request(app).get('/Test');
expect(res.statusCode).toEqual(200);
expect(res.body).toEqual({"message": "Hello World!"});
test("Intial Test", async () => {
const res = await request(app).get("/Test");
expect(res.statusCode).toEqual(200);
expect(res.body).toEqual({ message: "Hello World!" });
});

afterAll(done => {
server.close(done);
});
afterAll((done) => {
server.close(done);
});
2 changes: 1 addition & 1 deletion backend/utils/fileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AppError, AppErrorName } from "./AppError";
// Configure the file storage
const storage = multer.diskStorage({
destination: (req: Request, file, cb) => {
cb(null, "uploads"); // 'uploads' specified in index.ts
cb(null, "uploads"); // 'uploads' specified in server.ts
},
// concatenate hyphenated date string to ensure unique file name
filename: (req: Request, file, cb) => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/application_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export NVM_DIR="$HOME/.nvm"
npm install

#start our node app in the background
# First we need to build the index.ts file to index.js and put it in the build folder
# First we need to build the server.ts file to index.js and put it in the build folder
# Then we can run the index.js file
npm run build
npm start > app.out.log 2> app.err.log < /dev/null &

0 comments on commit 3271332

Please sign in to comment.