File tree Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const logger = require('morgan')
7
7
const indexRouter = require ( './routes/index' )
8
8
const usersRouter = require ( './routes/users' )
9
9
const authRouter = require ( './routes/auth' )
10
+ const appsRouter = require ( './routes/applications' )
10
11
11
12
const app = express ( )
12
13
@@ -33,5 +34,6 @@ app.use(cookieParser())
33
34
app . use ( '/' , indexRouter )
34
35
app . use ( '/users' , usersRouter )
35
36
app . use ( '/auth' , authRouter )
37
+ app . use ( '/applications' , appsRouter )
36
38
37
39
module . exports = app
Original file line number Diff line number Diff line change
1
+ const Controller = require ( './controller' )
2
+
3
+ class ApplicationController extends Controller {
4
+ /**
5
+ * Show all the applications. (15 per page)
6
+ * @param {import('express').Request } req
7
+ * @param {import('express').Response } res
8
+ */
9
+ index ( req , res ) { }
10
+
11
+ /**
12
+ * Show an application with a given ID
13
+ * @param {import('express').Request } req
14
+ * @param {import('express').Response } res
15
+ */
16
+ show ( req , res ) { }
17
+
18
+ /**
19
+ * Update information about a particular event
20
+ * @param {import('express').Request } req
21
+ * @param {import('express').Response } res
22
+ */
23
+ update ( req , res ) { }
24
+
25
+ /**
26
+ * Delete an application from the database
27
+ * @param {import('express').Request } req
28
+ * @param {import('express').Response } res
29
+ */
30
+ delete ( req , res ) { }
31
+ }
32
+
33
+ module . exports = new ApplicationController ( )
Original file line number Diff line number Diff line change
1
+ const router = require ( 'express' ) . Router ( )
2
+
3
+ /**
4
+ * Load all the applications from the database.
5
+ * The default result count is 15 per page
6
+ */
7
+ router . get ( '/' , ( req , res ) => { } )
8
+
9
+ /**
10
+ * Create a new application and return it with
11
+ * a 201 response
12
+ */
13
+ router . post ( '/' , ( req , res ) => { } )
14
+
15
+ /**
16
+ * Get a application using it's database ID
17
+ * A 404 response is returned if the application was
18
+ * Not found in the database
19
+ */
20
+ router . get ( '/:id' , ( req , res ) => { } )
21
+
22
+ /**
23
+ * Update an application's information.
24
+ * Returns 201 on success
25
+ */
26
+ router . put ( '/:id' , ( req , res ) => { } )
27
+
28
+ /**
29
+ * Deletes an application from the database
30
+ * A 200 response is returned on success
31
+ */
32
+ router . delete ( '/' , ( req , res ) => { } )
33
+
34
+ module . exports = router
You can’t perform that action at this time.
0 commit comments