This repository was archived by the owner on Jul 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-21
lines changed Expand file tree Collapse file tree 4 files changed +17
-21
lines changed Original file line number Diff line number Diff line change 10
10
"text" : " React is *great*!"
11
11
},
12
12
{
13
- "id" : 1466760920344 ,
14
- "author" : " Leticia " ,
15
- "text" : " Test "
13
+ "id" : 1464988635157 ,
14
+ "author" : " ben " ,
15
+ "text" : " *abc* "
16
16
},
17
17
{
18
- "id" : 1466762939294 ,
19
- "author" : " SDKJSLKGJ " ,
20
- "text" : " sjfklgjs "
18
+ "id" : 1464988636500 ,
19
+ "author" : " ben " ,
20
+ "text" : " *abc* "
21
21
},
22
22
{
23
- "id" : 1466778761498 ,
24
- "author" : " dfgdg" ,
25
- "text" : " dafg"
26
- },
27
- {
28
- "id" : 1466778933070 ,
29
- "author" : " dghl" ,
30
- "text" : " ;lkrg"
23
+ "id" : 1464988717637 ,
24
+ "author" : " evil" ,
25
+ "text" : " <a href=\" javascript:alert(1)\" >alert(1)</a>"
26
+ >>>>>>> upstream/master
31
27
}
32
28
]
Original file line number Diff line number Diff line change 5
5
< title > React Tutorial</ title >
6
6
<!-- Not present in the tutorial. Just for basic styling. -->
7
7
< link rel ="stylesheet " href ="css/base.css " />
8
- < script src ="https://cdnjs.cloudflare. com/ajax/libs/ react/ 15.1.0 /react.js "> </ script >
9
- < script src ="https://cdnjs.cloudflare. com/ajax/libs/ react/ 15.1.0 /react-dom.js "> </ script >
10
- < script src ="https://cdnjs.cloudflare. com/ajax/libs/ babel-core/5.6.16/browser .js "> </ script >
11
- < script src ="https://cdnjs.cloudflare. com/ajax/libs/ jquery/2.2.2 /jquery.min.js "> </ script >
12
- < script src ="https://cdnjs.cloudflare. com/ajax/libs/ remarkable/1.6.2 /remarkable.min.js "> </ script >
8
+ < script src ="https://unpkg. com/react@ 15.3.0/dist /react.js "> </ script >
9
+ < script src ="https://unpkg. com/react-dom@ 15.3.0/dist /react-dom.js "> </ script >
10
+ < script src ="
https://unpkg. com/babel-[email protected] /babel.min .js "
> </ script >
11
+ < script src ="https://unpkg. com/jquery@3.1.0/dist /jquery.min.js "> </ script >
12
+ < script src ="https://unpkg. com/remarkable@1.7.1/dist /remarkable.min.js "> </ script >
13
13
</ head >
14
14
< body >
15
15
< div id ="content "> </ div >
Original file line number Diff line number Diff line change 27
27
28
28
function routeRequest ()
29
29
{
30
- $ comments = file_get_contents ('comments.json ' );
31
30
$ uri = $ _SERVER ['REQUEST_URI ' ];
32
31
if ($ uri == '/ ' ) {
33
32
echo file_get_contents ('./public/index.html ' );
34
33
} elseif (preg_match ('/\/api\/comments(\?.*)?/ ' , $ uri )) {
34
+ $ comments = file_get_contents ('comments.json ' );
35
35
if ($ _SERVER ['REQUEST_METHOD ' ] === 'POST ' ) {
36
36
$ commentsDecoded = json_decode ($ comments , true );
37
37
$ commentsDecoded [] = [
Original file line number Diff line number Diff line change @@ -41,4 +41,4 @@ def comments_handler():
41
41
42
42
43
43
if __name__ == '__main__' :
44
- app .run (port = int (os .environ .get ("PORT" , 3000 )))
44
+ app .run (port = int (os .environ .get ("PORT" , 3000 )), debug = True )
You can’t perform that action at this time.
0 commit comments