@innet/server 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +213 -129
- package/index.es6.js +1 -1
- package/index.js +1 -0
- package/package.json +1 -1
- package/plugins/index.es6.js +1 -1
- package/plugins/index.js +1 -0
- package/plugins/proxy/index.es6.js +1 -1
- package/plugins/proxy/index.js +1 -0
- package/plugins/proxy/proxy.d.ts +5 -6
- package/plugins/proxy/proxy.es6.js +1 -1
- package/plugins/proxy/proxy.js +1 -0
package/README.md
CHANGED
|
@@ -51,7 +51,9 @@ Try it out in `app.tsx`
|
|
|
51
51
|
```typescript jsx
|
|
52
52
|
export default (
|
|
53
53
|
<server>
|
|
54
|
-
|
|
54
|
+
<action>
|
|
55
|
+
Hello World!
|
|
56
|
+
</action>
|
|
55
57
|
</server>
|
|
56
58
|
)
|
|
57
59
|
```
|
|
@@ -67,7 +69,9 @@ To change the port of the web server you can use `port` prop.
|
|
|
67
69
|
```typescript jsx
|
|
68
70
|
export default (
|
|
69
71
|
<server port={80}>
|
|
70
|
-
|
|
72
|
+
<action>
|
|
73
|
+
Hello World!
|
|
74
|
+
</action>
|
|
71
75
|
</server>
|
|
72
76
|
)
|
|
73
77
|
```
|
|
@@ -85,7 +89,9 @@ const ssl = {
|
|
|
85
89
|
|
|
86
90
|
export default (
|
|
87
91
|
<server ssl={ssl}>
|
|
88
|
-
|
|
92
|
+
<action>
|
|
93
|
+
Hello World!
|
|
94
|
+
</action>
|
|
89
95
|
</server>
|
|
90
96
|
)
|
|
91
97
|
```
|
|
@@ -97,7 +103,9 @@ You can show some message or do something right after the server starts.
|
|
|
97
103
|
```typescript jsx
|
|
98
104
|
export default (
|
|
99
105
|
<server onStart={console.log}>
|
|
100
|
-
|
|
106
|
+
<action>
|
|
107
|
+
Hello World!
|
|
108
|
+
</action>
|
|
101
109
|
</server>
|
|
102
110
|
)
|
|
103
111
|
```
|
|
@@ -108,7 +116,9 @@ You can log errors or do something else, when the server get an error.
|
|
|
108
116
|
```typescript jsx
|
|
109
117
|
export default (
|
|
110
118
|
<server onError={console.error}>
|
|
111
|
-
|
|
119
|
+
<action>
|
|
120
|
+
Hello World!
|
|
121
|
+
</action>
|
|
112
122
|
</server>
|
|
113
123
|
)
|
|
114
124
|
```
|
|
@@ -119,7 +129,9 @@ You can log any request with `onRequest` prop.
|
|
|
119
129
|
```typescript jsx
|
|
120
130
|
export default (
|
|
121
131
|
<server onRequest={console.log}>
|
|
122
|
-
|
|
132
|
+
<action>
|
|
133
|
+
Hello World!
|
|
134
|
+
</action>
|
|
123
135
|
</server>
|
|
124
136
|
)
|
|
125
137
|
```
|
|
@@ -131,7 +143,9 @@ You can react on destroy the server with `onDestroy` prop.
|
|
|
131
143
|
export default (
|
|
132
144
|
<server
|
|
133
145
|
onDestroy={() => console.log('destroy')}>
|
|
134
|
-
|
|
146
|
+
<action>
|
|
147
|
+
Hello World!
|
|
148
|
+
</action>
|
|
135
149
|
</server>
|
|
136
150
|
)
|
|
137
151
|
```
|
|
@@ -142,14 +156,16 @@ You can use `html` element to return html content.
|
|
|
142
156
|
```typescript jsx
|
|
143
157
|
export default (
|
|
144
158
|
<server>
|
|
145
|
-
<
|
|
146
|
-
<
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
<action>
|
|
160
|
+
<html>
|
|
161
|
+
<head>
|
|
162
|
+
<title>Innet App</title>
|
|
163
|
+
</head>
|
|
164
|
+
<body>
|
|
165
|
+
Hello World!
|
|
166
|
+
</body>
|
|
167
|
+
</html>
|
|
168
|
+
</action>
|
|
153
169
|
</server>
|
|
154
170
|
)
|
|
155
171
|
```
|
|
@@ -170,7 +186,9 @@ const content = (
|
|
|
170
186
|
|
|
171
187
|
export default (
|
|
172
188
|
<server>
|
|
173
|
-
|
|
189
|
+
<action>
|
|
190
|
+
{content}
|
|
191
|
+
</action>
|
|
174
192
|
</server>
|
|
175
193
|
)
|
|
176
194
|
```
|
|
@@ -185,9 +203,11 @@ const content = (
|
|
|
185
203
|
|
|
186
204
|
export default (
|
|
187
205
|
<server>
|
|
188
|
-
<
|
|
189
|
-
|
|
190
|
-
|
|
206
|
+
<action>
|
|
207
|
+
<header name='content-type' value='text/html'>
|
|
208
|
+
{content}
|
|
209
|
+
</header>
|
|
210
|
+
</action>
|
|
191
211
|
</server>
|
|
192
212
|
)
|
|
193
213
|
```
|
|
@@ -201,8 +221,10 @@ const content = (
|
|
|
201
221
|
|
|
202
222
|
export default (
|
|
203
223
|
<server>
|
|
204
|
-
<
|
|
205
|
-
|
|
224
|
+
<action>
|
|
225
|
+
<header name='content-type' value='text/html' />
|
|
226
|
+
{content}
|
|
227
|
+
</action>
|
|
206
228
|
</server>
|
|
207
229
|
)
|
|
208
230
|
```
|
|
@@ -213,9 +235,11 @@ You can return a file as a response.
|
|
|
213
235
|
```typescript jsx
|
|
214
236
|
export default (
|
|
215
237
|
<server>
|
|
216
|
-
<
|
|
217
|
-
<
|
|
218
|
-
|
|
238
|
+
<action>
|
|
239
|
+
<header name='cache-control' value='max-age=300'>
|
|
240
|
+
<file path='index.html' />
|
|
241
|
+
</header>
|
|
242
|
+
</action>
|
|
219
243
|
</server>
|
|
220
244
|
)
|
|
221
245
|
```
|
|
@@ -227,9 +251,11 @@ You can put content into the file to apply it only if the file does exist.
|
|
|
227
251
|
```typescript jsx
|
|
228
252
|
export default (
|
|
229
253
|
<server>
|
|
230
|
-
<
|
|
231
|
-
<
|
|
232
|
-
|
|
254
|
+
<action>
|
|
255
|
+
<file path='index.html'>
|
|
256
|
+
<header name='cache-control' value='max-age=300' />
|
|
257
|
+
</file>
|
|
258
|
+
</action>
|
|
233
259
|
</server>
|
|
234
260
|
)
|
|
235
261
|
```
|
|
@@ -241,9 +267,11 @@ The router helps to handle requests by route.
|
|
|
241
267
|
```typescript jsx
|
|
242
268
|
export default (
|
|
243
269
|
<server>
|
|
244
|
-
<
|
|
245
|
-
<
|
|
246
|
-
|
|
270
|
+
<action>
|
|
271
|
+
<router>
|
|
272
|
+
<file path='index.html' />
|
|
273
|
+
</router>
|
|
274
|
+
</action>
|
|
247
275
|
</server>
|
|
248
276
|
)
|
|
249
277
|
```
|
|
@@ -257,9 +285,11 @@ This property says that the content of the route should be run if the request me
|
|
|
257
285
|
```typescript jsx
|
|
258
286
|
export default (
|
|
259
287
|
<server>
|
|
260
|
-
<
|
|
261
|
-
<
|
|
262
|
-
|
|
288
|
+
<action>
|
|
289
|
+
<router method='GET'>
|
|
290
|
+
<file path='index.html' />
|
|
291
|
+
</router>
|
|
292
|
+
</action>
|
|
263
293
|
</server>
|
|
264
294
|
)
|
|
265
295
|
```
|
|
@@ -270,9 +300,11 @@ You can set `path` to match with it.
|
|
|
270
300
|
```typescript jsx
|
|
271
301
|
export default (
|
|
272
302
|
<server>
|
|
273
|
-
<
|
|
274
|
-
<
|
|
275
|
-
|
|
303
|
+
<action>
|
|
304
|
+
<router method='GET' path='/'>
|
|
305
|
+
<file path='index.html' />
|
|
306
|
+
</router>
|
|
307
|
+
</action>
|
|
276
308
|
</server>
|
|
277
309
|
)
|
|
278
310
|
```
|
|
@@ -284,9 +316,11 @@ This prop has regex like syntax, so you can set the path as you wish.
|
|
|
284
316
|
```typescript jsx
|
|
285
317
|
export default (
|
|
286
318
|
<server>
|
|
287
|
-
<
|
|
288
|
-
<
|
|
289
|
-
|
|
319
|
+
<action>
|
|
320
|
+
<router path='/user/[0-9]+'>
|
|
321
|
+
<file path='index.html' />
|
|
322
|
+
</router>
|
|
323
|
+
</action>
|
|
290
324
|
</server>
|
|
291
325
|
)
|
|
292
326
|
```
|
|
@@ -296,9 +330,11 @@ To provide named params from url, use named capturing groups of regex.
|
|
|
296
330
|
```typescript jsx
|
|
297
331
|
export default (
|
|
298
332
|
<server>
|
|
299
|
-
<
|
|
300
|
-
<
|
|
301
|
-
|
|
333
|
+
<action>
|
|
334
|
+
<router path='/user/(?<id>[\w-]+)'>
|
|
335
|
+
<file path='index.html' />
|
|
336
|
+
</router>
|
|
337
|
+
</action>
|
|
302
338
|
</server>
|
|
303
339
|
)
|
|
304
340
|
```
|
|
@@ -309,9 +345,11 @@ You can react on any path which starts with provided one.
|
|
|
309
345
|
```typescript jsx
|
|
310
346
|
export default (
|
|
311
347
|
<server>
|
|
312
|
-
<
|
|
313
|
-
<
|
|
314
|
-
|
|
348
|
+
<action>
|
|
349
|
+
<router path='/test' ish>
|
|
350
|
+
<file path='index.html' />
|
|
351
|
+
</router>
|
|
352
|
+
</action>
|
|
315
353
|
</server>
|
|
316
354
|
)
|
|
317
355
|
```
|
|
@@ -326,14 +364,16 @@ You can use a router inside another one and `prefix` helps reduce path prop.
|
|
|
326
364
|
```typescript jsx
|
|
327
365
|
export default (
|
|
328
366
|
<server>
|
|
329
|
-
<
|
|
330
|
-
<router path='/'>
|
|
331
|
-
<
|
|
367
|
+
<action>
|
|
368
|
+
<router path='/test' prefix='/test' ish>
|
|
369
|
+
<router path='/'>
|
|
370
|
+
<file path='index.html' />
|
|
371
|
+
</router>
|
|
372
|
+
<router path='/404'>
|
|
373
|
+
<file path='404.html' />
|
|
374
|
+
</router>
|
|
332
375
|
</router>
|
|
333
|
-
|
|
334
|
-
<file path='404.html' />
|
|
335
|
-
</router>
|
|
336
|
-
</router>
|
|
376
|
+
</action>
|
|
337
377
|
</server>
|
|
338
378
|
)
|
|
339
379
|
```
|
|
@@ -347,9 +387,11 @@ You can log the requests of any router.
|
|
|
347
387
|
```typescript jsx
|
|
348
388
|
export default (
|
|
349
389
|
<server>
|
|
350
|
-
<
|
|
351
|
-
<
|
|
352
|
-
|
|
390
|
+
<action>
|
|
391
|
+
<router path='/test' onMatch={console.log}>
|
|
392
|
+
<file path='index.html' />
|
|
393
|
+
</router>
|
|
394
|
+
</action>
|
|
353
395
|
</server>
|
|
354
396
|
)
|
|
355
397
|
```
|
|
@@ -364,12 +406,14 @@ To avoid this you can use switch element.
|
|
|
364
406
|
```typescript jsx
|
|
365
407
|
export default (
|
|
366
408
|
<server>
|
|
367
|
-
<
|
|
368
|
-
<
|
|
369
|
-
<
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
409
|
+
<action>
|
|
410
|
+
<switch>
|
|
411
|
+
<router path='/'>
|
|
412
|
+
<file path='index.html' />
|
|
413
|
+
</router>
|
|
414
|
+
<file path='404.html' />
|
|
415
|
+
</switch>
|
|
416
|
+
</action>
|
|
373
417
|
</server>
|
|
374
418
|
)
|
|
375
419
|
```
|
|
@@ -384,10 +428,12 @@ CMS helps to return files from a folder by path.
|
|
|
384
428
|
```typescript jsx
|
|
385
429
|
export default (
|
|
386
430
|
<server>
|
|
387
|
-
<
|
|
388
|
-
<
|
|
389
|
-
|
|
390
|
-
|
|
431
|
+
<action>
|
|
432
|
+
<switch>
|
|
433
|
+
<cms dir='cms' />
|
|
434
|
+
<file path='404.html' />
|
|
435
|
+
</switch>
|
|
436
|
+
</action>
|
|
391
437
|
</server>
|
|
392
438
|
)
|
|
393
439
|
```
|
|
@@ -399,12 +445,14 @@ You can use prefix with router to handle specific path.
|
|
|
399
445
|
```typescript jsx
|
|
400
446
|
export default (
|
|
401
447
|
<server>
|
|
402
|
-
<
|
|
403
|
-
<
|
|
404
|
-
<
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
448
|
+
<action>
|
|
449
|
+
<switch>
|
|
450
|
+
<router path='/cms' ish>
|
|
451
|
+
<cms dir='cms' prefix='/cms' />
|
|
452
|
+
</router>
|
|
453
|
+
<file path='404.html' />
|
|
454
|
+
</switch>
|
|
455
|
+
</action>
|
|
408
456
|
</server>
|
|
409
457
|
)
|
|
410
458
|
```
|
|
@@ -414,12 +462,14 @@ You can input something into `cms`, if requested file is exist then the content
|
|
|
414
462
|
```typescript jsx
|
|
415
463
|
export default (
|
|
416
464
|
<server>
|
|
417
|
-
<
|
|
418
|
-
<
|
|
419
|
-
<
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
465
|
+
<action>
|
|
466
|
+
<switch>
|
|
467
|
+
<cms dir='cms'>
|
|
468
|
+
<header name='cache-control' value='max-age=300' />
|
|
469
|
+
</cms>
|
|
470
|
+
<file path='404.html' />
|
|
471
|
+
</switch>
|
|
472
|
+
</action>
|
|
423
473
|
</server>
|
|
424
474
|
)
|
|
425
475
|
```
|
|
@@ -430,10 +480,12 @@ You can proxy request.
|
|
|
430
480
|
```typescript jsx
|
|
431
481
|
export default (
|
|
432
482
|
<server>
|
|
433
|
-
<
|
|
434
|
-
<
|
|
435
|
-
|
|
436
|
-
|
|
483
|
+
<action>
|
|
484
|
+
<switch>
|
|
485
|
+
<cms dir='cms' />
|
|
486
|
+
<proxy to='https://site.com' />
|
|
487
|
+
</switch>
|
|
488
|
+
</action>
|
|
437
489
|
</server>
|
|
438
490
|
)
|
|
439
491
|
```
|
|
@@ -447,10 +499,12 @@ You can redirect users to another resource.
|
|
|
447
499
|
```typescript jsx
|
|
448
500
|
export default (
|
|
449
501
|
<server>
|
|
450
|
-
<
|
|
451
|
-
<
|
|
452
|
-
|
|
453
|
-
|
|
502
|
+
<action>
|
|
503
|
+
<switch>
|
|
504
|
+
<cms dir='cms' />
|
|
505
|
+
<redirect to='https://site.com' />
|
|
506
|
+
</switch>
|
|
507
|
+
</action>
|
|
454
508
|
</server>
|
|
455
509
|
)
|
|
456
510
|
```
|
|
@@ -461,10 +515,12 @@ By default, status is `301`, you can change it with `status` prop.
|
|
|
461
515
|
```typescript jsx
|
|
462
516
|
export default (
|
|
463
517
|
<server>
|
|
464
|
-
<
|
|
465
|
-
<
|
|
466
|
-
|
|
467
|
-
|
|
518
|
+
<action>
|
|
519
|
+
<switch>
|
|
520
|
+
<cms dir='cms' />
|
|
521
|
+
<redirect to='https://site.com' status={302} />
|
|
522
|
+
</switch>
|
|
523
|
+
</action>
|
|
468
524
|
</server>
|
|
469
525
|
)
|
|
470
526
|
```
|
|
@@ -474,10 +530,12 @@ Also, you can use string key of status.
|
|
|
474
530
|
```typescript jsx
|
|
475
531
|
export default (
|
|
476
532
|
<server>
|
|
477
|
-
<
|
|
478
|
-
<
|
|
479
|
-
|
|
480
|
-
|
|
533
|
+
<action>
|
|
534
|
+
<switch>
|
|
535
|
+
<cms dir='cms' />
|
|
536
|
+
<redirect to='https://site.com' status='found'/>
|
|
537
|
+
</switch>
|
|
538
|
+
</action>
|
|
481
539
|
</server>
|
|
482
540
|
)
|
|
483
541
|
```
|
|
@@ -490,12 +548,14 @@ Any component is just a function which returns content that should be run.
|
|
|
490
548
|
```typescript jsx
|
|
491
549
|
export const Server = ({ cmsPrefix }) => (
|
|
492
550
|
<server>
|
|
493
|
-
<
|
|
494
|
-
<
|
|
495
|
-
<
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
551
|
+
<action>
|
|
552
|
+
<switch>
|
|
553
|
+
<router path={cmsPrefix} ish>
|
|
554
|
+
<cms dir='cms' prefix={cmsPrefix} />
|
|
555
|
+
</router>
|
|
556
|
+
<file path='404.html' />
|
|
557
|
+
</switch>
|
|
558
|
+
</action>
|
|
499
559
|
</server>
|
|
500
560
|
)
|
|
501
561
|
```
|
|
@@ -532,9 +592,11 @@ function Html ({ title }) {
|
|
|
532
592
|
|
|
533
593
|
export default (
|
|
534
594
|
<server>
|
|
535
|
-
<
|
|
536
|
-
|
|
537
|
-
|
|
595
|
+
<action>
|
|
596
|
+
<Html title='main'>
|
|
597
|
+
Hello World!
|
|
598
|
+
</Html>
|
|
599
|
+
</action>
|
|
538
600
|
</server>
|
|
539
601
|
)
|
|
540
602
|
```
|
|
@@ -549,7 +611,9 @@ If you work on REST API, you can use `success` or `error` as an answer
|
|
|
549
611
|
```typescript jsx
|
|
550
612
|
export default (
|
|
551
613
|
<server>
|
|
552
|
-
<
|
|
614
|
+
<action>
|
|
615
|
+
<success />
|
|
616
|
+
</action>
|
|
553
617
|
</server>
|
|
554
618
|
)
|
|
555
619
|
```
|
|
@@ -564,9 +628,11 @@ const data = {
|
|
|
564
628
|
|
|
565
629
|
export default (
|
|
566
630
|
<server>
|
|
567
|
-
<
|
|
568
|
-
|
|
569
|
-
|
|
631
|
+
<action>
|
|
632
|
+
<success>
|
|
633
|
+
{data}
|
|
634
|
+
</success>
|
|
635
|
+
</action>
|
|
570
636
|
</server>
|
|
571
637
|
)
|
|
572
638
|
```
|
|
@@ -582,9 +648,11 @@ const data = {
|
|
|
582
648
|
|
|
583
649
|
export default (
|
|
584
650
|
<server>
|
|
585
|
-
<
|
|
586
|
-
|
|
587
|
-
|
|
651
|
+
<action>
|
|
652
|
+
<success status='created'>
|
|
653
|
+
{data}
|
|
654
|
+
</success>
|
|
655
|
+
</action>
|
|
588
656
|
</server>
|
|
589
657
|
)
|
|
590
658
|
```
|
|
@@ -600,9 +668,11 @@ const data = {
|
|
|
600
668
|
|
|
601
669
|
export default (
|
|
602
670
|
<server>
|
|
603
|
-
<
|
|
604
|
-
{
|
|
605
|
-
|
|
671
|
+
<action>
|
|
672
|
+
<success status={201}>
|
|
673
|
+
{data}
|
|
674
|
+
</success>
|
|
675
|
+
</action>
|
|
606
676
|
</server>
|
|
607
677
|
)
|
|
608
678
|
```
|
|
@@ -613,7 +683,9 @@ You can return an error to the user.
|
|
|
613
683
|
```typescript jsx
|
|
614
684
|
export default (
|
|
615
685
|
<server>
|
|
616
|
-
<
|
|
686
|
+
<action>
|
|
687
|
+
<error />
|
|
688
|
+
</action>
|
|
617
689
|
</server>
|
|
618
690
|
)
|
|
619
691
|
```
|
|
@@ -629,9 +701,11 @@ const data = {
|
|
|
629
701
|
|
|
630
702
|
export default (
|
|
631
703
|
<server>
|
|
632
|
-
<
|
|
633
|
-
|
|
634
|
-
|
|
704
|
+
<action>
|
|
705
|
+
<error>
|
|
706
|
+
{data}
|
|
707
|
+
</error>
|
|
708
|
+
</action>
|
|
635
709
|
</server>
|
|
636
710
|
)
|
|
637
711
|
```
|
|
@@ -646,9 +720,11 @@ const data = {
|
|
|
646
720
|
|
|
647
721
|
export default (
|
|
648
722
|
<server>
|
|
649
|
-
<
|
|
650
|
-
|
|
651
|
-
|
|
723
|
+
<action>
|
|
724
|
+
<error status='notFound'>
|
|
725
|
+
{data}
|
|
726
|
+
</error>
|
|
727
|
+
</action>
|
|
652
728
|
</server>
|
|
653
729
|
)
|
|
654
730
|
```
|
|
@@ -661,9 +737,11 @@ const data = {
|
|
|
661
737
|
|
|
662
738
|
export default (
|
|
663
739
|
<server>
|
|
664
|
-
<
|
|
665
|
-
{
|
|
666
|
-
|
|
740
|
+
<action>
|
|
741
|
+
<error status={404}>
|
|
742
|
+
{data}
|
|
743
|
+
</error>
|
|
744
|
+
</action>
|
|
667
745
|
</server>
|
|
668
746
|
)
|
|
669
747
|
```
|
|
@@ -680,7 +758,9 @@ const Login = ({ token }) => (
|
|
|
680
758
|
|
|
681
759
|
export default (
|
|
682
760
|
<server>
|
|
683
|
-
<
|
|
761
|
+
<action>
|
|
762
|
+
<Login token='test' />
|
|
763
|
+
</action>
|
|
684
764
|
</server>
|
|
685
765
|
)
|
|
686
766
|
```
|
|
@@ -690,9 +770,11 @@ To remove cookie just provide key without value.
|
|
|
690
770
|
```typescript jsx
|
|
691
771
|
export default (
|
|
692
772
|
<server>
|
|
693
|
-
<
|
|
694
|
-
<
|
|
695
|
-
|
|
773
|
+
<action>
|
|
774
|
+
<cookie key='token'>
|
|
775
|
+
<success />
|
|
776
|
+
</cookie>
|
|
777
|
+
</action>
|
|
696
778
|
</server>
|
|
697
779
|
)
|
|
698
780
|
```
|
|
@@ -814,9 +896,11 @@ Use named capturing groups of regex in a route path prop to add the `params`.
|
|
|
814
896
|
```typescript jsx
|
|
815
897
|
export default (
|
|
816
898
|
<server>
|
|
817
|
-
<
|
|
818
|
-
<
|
|
819
|
-
|
|
899
|
+
<action>
|
|
900
|
+
<router path='/user/(?<id>[\w-]+)'>
|
|
901
|
+
<Router />
|
|
902
|
+
</router>
|
|
903
|
+
</action>
|
|
820
904
|
</server>
|
|
821
905
|
)
|
|
822
906
|
```
|
package/index.es6.js
CHANGED
|
@@ -6,7 +6,7 @@ export { success, successStatuses } from './plugins/success/success.es6.js';
|
|
|
6
6
|
export { error, errorStatuses } from './plugins/error/error.es6.js';
|
|
7
7
|
export { cms } from './plugins/cms/cms.es6.js';
|
|
8
8
|
export { file } from './plugins/file/file.es6.js';
|
|
9
|
-
export { proxy } from './plugins/proxy/proxy.es6.js';
|
|
9
|
+
export { proxy, proxyServer } from './plugins/proxy/proxy.es6.js';
|
|
10
10
|
export { redirect, redirectStatuses } from './plugins/redirect/redirect.es6.js';
|
|
11
11
|
export { validation, validationContext } from './plugins/validation/validation.es6.js';
|
|
12
12
|
export { formatter } from './plugins/formatter/formatter.es6.js';
|
package/index.js
CHANGED
|
@@ -50,6 +50,7 @@ exports.errorStatuses = error.errorStatuses;
|
|
|
50
50
|
exports.cms = cms.cms;
|
|
51
51
|
exports.file = file.file;
|
|
52
52
|
exports.proxy = proxy.proxy;
|
|
53
|
+
exports.proxyServer = proxy.proxyServer;
|
|
53
54
|
exports.redirect = redirect.redirect;
|
|
54
55
|
exports.redirectStatuses = redirect.redirectStatuses;
|
|
55
56
|
exports.validation = validation.validation;
|
package/package.json
CHANGED
package/plugins/index.es6.js
CHANGED
|
@@ -5,7 +5,7 @@ export { success, successStatuses } from './success/success.es6.js';
|
|
|
5
5
|
export { error, errorStatuses } from './error/error.es6.js';
|
|
6
6
|
export { cms } from './cms/cms.es6.js';
|
|
7
7
|
export { file } from './file/file.es6.js';
|
|
8
|
-
export { proxy } from './proxy/proxy.es6.js';
|
|
8
|
+
export { proxy, proxyServer } from './proxy/proxy.es6.js';
|
|
9
9
|
export { redirect, redirectStatuses } from './redirect/redirect.es6.js';
|
|
10
10
|
export { validation, validationContext } from './validation/validation.es6.js';
|
|
11
11
|
export { formatter } from './formatter/formatter.es6.js';
|
package/plugins/index.js
CHANGED
|
@@ -33,6 +33,7 @@ exports.errorStatuses = error.errorStatuses;
|
|
|
33
33
|
exports.cms = cms.cms;
|
|
34
34
|
exports.file = file.file;
|
|
35
35
|
exports.proxy = proxy.proxy;
|
|
36
|
+
exports.proxyServer = proxy.proxyServer;
|
|
36
37
|
exports.redirect = redirect.redirect;
|
|
37
38
|
exports.redirectStatuses = redirect.redirectStatuses;
|
|
38
39
|
exports.validation = validation.validation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { proxy } from './proxy.es6.js';
|
|
1
|
+
export { proxy, proxyServer } from './proxy.es6.js';
|
package/plugins/proxy/index.js
CHANGED
package/plugins/proxy/proxy.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Handler } from 'innet';
|
|
2
|
+
import { JSXElement } from '@innet/jsx';
|
|
3
|
+
import httpProxy from 'http-proxy';
|
|
2
4
|
export interface ProxyProps {
|
|
3
5
|
to: string;
|
|
6
|
+
secure?: boolean;
|
|
4
7
|
}
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
to: any;
|
|
8
|
-
secure?: boolean;
|
|
9
|
-
};
|
|
10
|
-
}, handler: Handler): symbol;
|
|
8
|
+
export declare const proxyServer: httpProxy;
|
|
9
|
+
export declare function proxy({ props: { to, secure } }: JSXElement<string, ProxyProps>, handler: Handler): symbol;
|
package/plugins/proxy/proxy.js
CHANGED