File tree 4 files changed +26
-0
lines changed
4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 19
19
"homepage" : " https://github.com/erickpeniche/backstop-react-challenge-backend#readme" ,
20
20
"devDependencies" : {
21
21
"@babel/core" : " ^7.12.10" ,
22
+ "@babel/plugin-transform-runtime" : " ^7.12.10" ,
22
23
"@babel/preset-env" : " ^7.12.11" ,
23
24
"babel-loader" : " ^8.2.2" ,
24
25
"cross-env" : " ^7.0.3" ,
32
33
"webpack-cli" : " ^4.3.1"
33
34
},
34
35
"dependencies" : {
36
+ "@babel/runtime" : " ^7.12.5" ,
35
37
"cors" : " ^2.8.5" ,
36
38
"express" : " ^4.17.1"
37
39
}
Original file line number Diff line number Diff line change 1
1
import express from 'express' ;
2
2
import cors from 'cors' ;
3
+ import DigimonRoutes from './routes/digimon' ;
3
4
4
5
const app = express ( ) ;
5
6
const port = 3000 ;
6
7
7
8
app . use ( cors ( ) ) ;
9
+ app . use ( '/api/v1/digimon' , DigimonRoutes ) ;
8
10
9
11
app . listen ( port , ( ) => {
10
12
console . log ( `Back-End listening at http://localhost:${ port } ` ) ;
Original file line number Diff line number Diff line change
1
+ import { Router } from 'express' ;
2
+
3
+ const router = new Router ( ) ;
4
+
5
+ export const getAllDigimons = async ( req , res ) => {
6
+ res . json ( { test : true } ) ;
7
+ } ;
8
+
9
+ export const getDigimonById = async ( ) => {
10
+
11
+ } ;
12
+
13
+ export const getRandomDigimon = async ( ) => {
14
+
15
+ } ;
16
+
17
+ router . get ( '/' , getAllDigimons ) ;
18
+ router . get ( '/:id' , getDigimonById ) ;
19
+ router . get ( '/random' , getRandomDigimon ) ;
20
+
21
+ export default router ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ module.exports = {
26
26
loader : 'babel-loader' ,
27
27
options : {
28
28
presets : [ '@babel/preset-env' ] ,
29
+ plugins : [ '@babel/plugin-transform-runtime' ] ,
29
30
} ,
30
31
} ,
31
32
] ,
You can’t perform that action at this time.
0 commit comments