-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
46 lines (39 loc) · 853 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import express from 'express';
const app = express();
app.use(express.json());
type Review = {
id: number;
professorName: string;
courseName: string;
rating: number;
grade: string;
tags: string[];
takeAgain: boolean;
content: string;
}
const reviews: Review[] = [
{
id: 1,
professorName: 'John Doe',
courseName: 'Introduction to Computer Science',
rating: 5,
grade: 'A',
tags: ['Java', 'Programming'],
takeAgain: true,
content: 'This is a great course!'
},
{
id: 2,
professorName: 'Jane Smith',
courseName: 'Advanced Computer Science',
rating: 4,
grade: 'B',
tags: ['Java', 'DSA'],
takeAgain: false,
content: 'This course is challenging but worth it.'
}
];
// write your routes here
app.listen(3000, () => {
console.log('App listening on port 3000!');
});