File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,21 @@ var app = express();
88
99var  moesif  =  require ( './lib' ) ; 
1010
11- var   TEST_APPLICATION_ID  =  'Your Moesif Application ID ' ; 
11+ const   APPLICATION_ID  =  'YOUR_MOESIF_APPLICATION_ID ' ; 
1212
13- var  moesifMiddleWare  =  moesif ( { applicationId : TEST_API_SECRET_KEY } ) ; 
13+ var  moesifMiddleWare  =  moesif ( {   applicationId : APPLICATION_ID   } ) ; 
1414
1515app . use ( moesifMiddleWare ) ; 
16+ app . use ( express . json ( ) ) ; 
1617
1718app . get ( '/' ,  function  ( req ,  res )  { 
18-   res . json ( { a : 'abc' } ) ; 
19+   res . json ( {   a : 'abc'   } ) ; 
1920} ) ; 
2021
2122app . get ( '/abc' ,  function  ( req ,  res )  { 
22-   res . json ( { abc : 'abcefg' } ) ; 
23+   res . json ( {   abc : 'abcefg'   } ) ; 
2324} ) ; 
2425
25- app . listen ( 3000 ,   function   ( )  { 
26-   console . log ( ' Example app listening on port 3000!' ) ; 
26+ const   server   =   app . listen ( 0 ,   ( )   =>  { 
27+   console . log ( ` Example app listening on port ${ server . address ( ) . port } ` ) ; 
2728} ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments