Skip to content

Commit 534a226

Browse files
author
Rishit Bansal
committed
fix: Fix server ts build
1 parent 6c9a467 commit 534a226

File tree

8 files changed

+34
-11
lines changed

8 files changed

+34
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_modules/
22
data/
33
.vscode/
44
.env
5+
build
6+
dist

models/challenge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as mongoose from "mongoose";
1+
import mongoose from "mongoose";
22
const Schema = mongoose.Schema;
33

44
const challengeSchema = new Schema(

models/leaderboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as mongoose from "mongoose";
1+
import mongoose from "mongoose";
22
const Schema = mongoose.Schema;
33

44
const leaderboard = new Schema({

models/solvedChallenges.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as mongoose from "mongoose";
1+
import mongoose from "mongoose";
22
const Schema = mongoose.Schema;
33

44
const solvedChallengeSchema = new Schema(

models/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as mongoose from "mongoose";
1+
import mongoose from "mongoose";
22
const Schema = mongoose.Schema;
33

44
const userSchema = new Schema(

routes/auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import * as sgMail from "@sendgrid/mail";
1414

1515
const router = Router();
1616

17+
1718
router.post("/register", async (req, res) => {
1819
if (
1920
!req.body.name ||

server.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as express from "express";
2-
import * as logger from "morgan";
3-
import * as bodyParser from "body-parser";
4-
import * as mongoose from "mongoose";
5-
import * as session from "express-session";
6-
import * as socketio from "socket.io";
7-
import * as http from "http";
1+
import express from "express";
2+
import logger from "morgan";
3+
import bodyParser from "body-parser";
4+
import mongoose from "mongoose";
5+
import session from "express-session";
6+
import socketio from "socket.io";
7+
import http from "http";
88
import { submissionData, submissionResponse } from './models/socketInterfaces';
99
import { handleSubmission as handleSubmission } from './routes/handleSubmission';
1010
import authRoutes from './routes/auth';

tsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"esModuleInterop": true,
5+
"allowSyntheticDefaultImports": true,
6+
"target": "es6",
7+
"moduleResolution": "node",
8+
"sourceMap": true,
9+
"outDir": "dist",
10+
"baseUrl": ".",
11+
"paths": {
12+
"*": [
13+
"node_modules/*"
14+
]
15+
}
16+
},
17+
"include": [
18+
"**/*.ts"
19+
]
20+
}

0 commit comments

Comments
 (0)