File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class StaticServer {
22
22
break ;
23
23
case 2 :
24
24
this . port = `${ port } ` ;
25
- if ( typeof ( arguments [ 1 ] ) === 'string' ) {
25
+ if ( typeof ( arguments [ 1 ] ) === 'string' ) {
26
26
this . root = root ;
27
27
this . localOnly = false ;
28
28
this . keepAlive = false ;
@@ -35,7 +35,7 @@ class StaticServer {
35
35
}
36
36
break ;
37
37
case 1 :
38
- if ( typeof ( arguments [ 0 ] ) === 'number' ) {
38
+ if ( typeof ( arguments [ 0 ] ) === 'number' ) {
39
39
this . port = `${ port } ` ;
40
40
this . root = ROOT ;
41
41
this . localOnly = false ;
@@ -64,7 +64,7 @@ class StaticServer {
64
64
}
65
65
66
66
start ( ) {
67
- if ( this . running ) {
67
+ if ( this . running ) {
68
68
return Promise . resolve ( this . origin ) ;
69
69
}
70
70
Original file line number Diff line number Diff line change 6
6
#import " GCDWebServerFileResponse.h"
7
7
#import " GCDWebServerHTTPStatusCodes.h"
8
8
9
- @interface FPStaticServer : NSObject <RCTBridgeModule>
10
- {
9
+ @interface FPStaticServer : NSObject <RCTBridgeModule> {
11
10
GCDWebServer *_webServer;
12
11
}
13
12
14
- @property (nonatomic , retain ) NSString *localPath;
15
- @property (nonatomic , retain ) NSString *url;
13
+ @property (nonatomic , retain ) NSString *localPath;
14
+ @property (nonatomic , retain ) NSString *url;
16
15
17
- @property (nonatomic , retain ) NSString *www_root;
18
- @property (nonatomic , retain ) NSNumber *port;
19
- @property (nonatomic , retain ) NSDictionary <NSString *, NSString *> *mime_type_overrides;
20
- @property (assign ) BOOL localhost_only;
21
- @property (assign ) BOOL keep_alive;
16
+ @property (nonatomic , retain ) NSString *www_root;
17
+ @property (nonatomic , retain ) NSNumber *port;
18
+ @property (nonatomic , retain ) NSDictionary <NSString *, NSString *> *mime_type_overrides;
19
+ @property (assign ) BOOL localhost_only;
20
+ @property (assign ) BOOL keep_alive;
22
21
23
22
@end
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ - (dispatch_queue_t)methodQueue
30
30
}
31
31
32
32
33
- RCT_EXPORT_METHOD (start:(NSString *)port
33
+ RCT_EXPORT_METHOD (start: (NSString *)port
34
34
root:(NSString *)optroot
35
35
localOnly:(BOOL *)localhost_only
36
36
keepAlive:(BOOL *)keep_alive
@@ -107,7 +107,7 @@ - (dispatch_queue_t)methodQueue
107
107
response = [GCDWebServerResponse responseWithStatusCode: kGCDWebServerHTTPStatusCode_NotFound ];
108
108
}
109
109
} else if ([fileType isEqualToString: NSFileTypeRegular ]) {
110
- if (allowRangeRequests) {
110
+ if (allowRangeRequests) {
111
111
response = [[GCDWebServerFileResponse alloc ] initWithFile: filePath byteRange: request.byteRange isAttachment: NO mimeTypeOverrides: mime_type_overrides] ;
112
112
[response setValue: @" bytes" forAdditionalHeader: @" Accept-Ranges" ];
113
113
} else {
You can’t perform that action at this time.
0 commit comments