File tree Expand file tree Collapse file tree 7 files changed +84
-0
lines changed Expand file tree Collapse file tree 7 files changed +84
-0
lines changed Original file line number Diff line number Diff line change
1
+ # imad-app-v2
2
+
3
+ Base repository for IMAD V2 course application. All users will fork this repo to create their own application.
4
+
5
+ PLEASE DO NOT submit PRs, or push to this git repository!
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " imad-2016-base" ,
3
+ "version" : " 0.1.0" ,
4
+ "description" : " IMAD 2016 course app" ,
5
+ "main" : " server.js" ,
6
+ "scripts" : {
7
+ "test" : " echo \" Error: no test specified\" && exit 1"
8
+ },
9
+ "author" : " " ,
10
+ "license" : " ISC" ,
11
+ "dependencies" : {
12
+ "express" : " ^4.14.0" ,
13
+ "morgan" : " ^1.7.0"
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ var express = require ( 'express' ) ;
2
+ var morgan = require ( 'morgan' ) ;
3
+ var path = require ( 'path' ) ;
4
+
5
+ var app = express ( ) ;
6
+ app . use ( morgan ( 'combined' ) ) ;
7
+
8
+ app . get ( '/' , function ( req , res ) {
9
+ res . sendFile ( path . join ( __dirname , 'ui' , 'index.html' ) ) ;
10
+ } ) ;
11
+
12
+ app . get ( '/ui/style.css' , function ( req , res ) {
13
+ res . sendFile ( path . join ( __dirname , 'ui' , 'style.css' ) ) ;
14
+ } ) ;
15
+
16
+ app . get ( '/ui/madi.png' , function ( req , res ) {
17
+ res . sendFile ( path . join ( __dirname , 'ui' , 'madi.png' ) ) ;
18
+ } ) ;
19
+
20
+
21
+ var port = 8080 ; // Use 8080 for local development because you might already have apache running on 80
22
+ app . listen ( 8080 , function ( ) {
23
+ console . log ( `IMAD course app listening on port ${ port } !` ) ;
24
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html >
3
+ < head >
4
+ < link href ="/ui/style.css " rel ="stylesheet " />
5
+ </ head >
6
+ < body >
7
+ < div class ="center ">
8
+ < img src ="/ui/madi.png " class ="img-medium "/>
9
+ </ div >
10
+ < br >
11
+ < div class ="center text-big bold ">
12
+ Hi! I am your webapp.
13
+ </ div >
14
+ < script type ="text/javascript " src ="/ui/main.js ">
15
+ </ script >
16
+ </ body >
17
+ </ html >
Original file line number Diff line number Diff line change
1
+ console . log ( 'Loaded!' ) ;
Original file line number Diff line number Diff line change
1
+ body {
2
+ font-family : sans-serif;
3
+ background-color : lightgrey;
4
+ margin-top : 75px ;
5
+ }
6
+
7
+ .center {
8
+ text-align : center;
9
+ }
10
+
11
+ .text-big {
12
+ font-size : 300% ;
13
+ }
14
+
15
+ .bold {
16
+ font-weight : bold;
17
+ }
18
+
19
+ .img-medium {
20
+ height : 200px ;
21
+ }
22
+
You can’t perform that action at this time.
0 commit comments