@@ -7,7 +7,7 @@ import emailAdapter from './MockEmailAdapter.js';
7
7
const app = express ( ) ;
8
8
const __dirname = path . resolve ( ) ;
9
9
10
- const parseServer = new ParseServer ( {
10
+ const server = new ParseServer ( {
11
11
appName : "MyTestApp" ,
12
12
appId : "app-id-here" ,
13
13
masterKey : "master-key-here" ,
@@ -48,10 +48,10 @@ const parseServer = new ParseServer({
48
48
} ,
49
49
} ) ;
50
50
51
- await parseServer . start ( ) ;
51
+ await server . start ( ) ;
52
52
53
53
// Serve the Parse API on the /parse URL prefix
54
- app . use ( '/parse' , parseServer . app ) ;
54
+ app . use ( '/parse' , server . app ) ;
55
55
56
56
const port = 1337 ;
57
57
app . listen ( port , function ( ) {
@@ -92,11 +92,11 @@ function onRequest(req) {
92
92
}
93
93
94
94
// Create TLS enabled server
95
- const server = https . createServer ( serverOptions , app ) ;
96
- server . on ( 'request' , onRequest ) ;
95
+ const httpsServer = https . createServer ( serverOptions , app ) ;
96
+ httpsServer . on ( 'request' , onRequest ) ;
97
97
98
98
// Start Server
99
- server . listen ( options . port , function ( ) {
99
+ httpsServer . listen ( options . port , function ( ) {
100
100
console . error ( '[ Parse Test Https Server running on port ' + options . port + ' ]' ) ;
101
101
} ) ;
102
102
@@ -134,13 +134,13 @@ req.on('socket', socket => {
134
134
const fingerprint = socket . getPeerCertificate ( ) . fingerprint ;
135
135
136
136
// Check if certificate is valid
137
- if ( socket . authorized === false ) {
137
+ if ( socket . authorized === false ) {
138
138
req . emit ( 'error' , new Error ( socket . authorizationError ) ) ;
139
139
return req . destroy ( ) ;
140
140
}
141
141
142
142
// Check if fingerprint matches
143
- if ( clientFingerprints . indexOf ( fingerprint ) === - 1 ) {
143
+ if ( clientFingerprints . indexOf ( fingerprint ) === - 1 ) {
144
144
req . emit ( 'error' , new Error ( 'Fingerprint does not match' ) ) ;
145
145
return req . destroy ( ) ;
146
146
}
0 commit comments