File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { Router } from 'express' ;
2
+
3
+ import {
4
+ searchQuestionsByTitle ,
5
+ getQuestions ,
6
+ getQuestionDetails ,
7
+ getRandomQuestion ,
8
+ } from '@/controller/question-controller' ;
9
+
10
+ const router = Router ( ) ;
11
+
12
+ router . get ( '/search' , searchQuestionsByTitle ) ;
13
+
14
+ router . get ( '/' , getQuestions ) ;
15
+
16
+ router . get ( '/:questionId' , getQuestionDetails ) ;
17
+
18
+ router . post ( '/random' , getRandomQuestion ) ;
19
+
20
+ export default router ;
Original file line number Diff line number Diff line change
1
+ CREATE TABLE IF NOT EXISTS " users" (
2
+ " id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL ,
3
+ " email" varchar (255 ) NOT NULL ,
4
+ " username" varchar (255 ) NOT NULL ,
5
+ " first_name" varchar (255 ) NOT NULL ,
6
+ " last_name" varchar (255 ) NOT NULL ,
7
+ " password" varchar (255 ) NOT NULL ,
8
+ " failed_attempts" smallint DEFAULT 0 ,
9
+ " unlock_time" timestamp (6 ) with time zone,
10
+ " attempted_questions" integer [],
11
+ CONSTRAINT " users_email_unique" UNIQUE(" email" ),
12
+ CONSTRAINT " users_username_unique" UNIQUE(" username" )
13
+ );
Original file line number Diff line number Diff line change
1
+ import { Navigate } from 'react-router-dom' ;
2
+ import { ROUTES } from '@/lib/routes' ;
3
+
4
+ export const HomePage = ( ) => {
5
+ // TODO: Add actual home page
6
+ return < Navigate to = { ROUTES . QUESTIONS } /> ;
7
+ } ;
You can’t perform that action at this time.
0 commit comments