File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var server = require ( './server' ) ;
4
+ var port = process . env . PORT || 3000 ;
5
+
6
+ server . listen ( port , function ( ) {
7
+ console . log ( 'Server running on port %d' , port ) ;
8
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " testing-express-api" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " Testing Express APIs with Supertest" ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "start" : " node index" ,
8
+ "test" : " node test"
9
+ },
10
+ "repository" : {
11
+ "type" : " git" ,
12
+ "url" : " https://github.com/knownasilya/testing-express-api.git"
13
+ },
14
+ "keywords" : [
15
+ " testing" ,
16
+ " express" ,
17
+ " api" ,
18
+ " supertest"
19
+ ],
20
+ "author" : " Ilya Radchenko <ilya@burstcreations.com>" ,
21
+ "license" : " ISC" ,
22
+ "bugs" : {
23
+ "url" : " https://github.com/knownasilya/testing-express-api/issues"
24
+ },
25
+ "homepage" : " https://github.com/knownasilya/testing-express-api" ,
26
+ "dependencies" : {
27
+ "express" : " ^4.11.2"
28
+ },
29
+ "devDependencies" : {
30
+ "supertest" : " ^0.15.0" ,
31
+ "tape" : " ^3.5.0"
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var express = require ( 'express' ) ;
4
+ var app = express ( ) ;
5
+ var users = [ 'John' , 'Betty' , 'Hal' ] ;
6
+
7
+ app . get ( '/api/users' , function ( req , res ) {
8
+ res . json ( users ) ;
9
+ } ) ;
10
+
11
+ module . exports = app ;
You can’t perform that action at this time.
0 commit comments