File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ module.exports = async () => {
77
77
prefixRewrite : '/endpoint-proxy-methods-put' ,
78
78
target : 'http://localhost:3000' ,
79
79
methods : [ 'PUT' ]
80
+ } , {
81
+ prefix : '/lambda' ,
82
+ proxyType : 'lambda' ,
83
+ target : 'a-lambda-function-name' ,
84
+ hooks : {
85
+ async onRequest ( req , res ) {
86
+ res . end ( 'Go Serverless!' )
87
+
88
+ return true
89
+ }
90
+ }
80
91
} ]
81
92
}
82
93
}
Original file line number Diff line number Diff line change 1
1
/* global describe, it */
2
2
const expect = require ( 'chai' ) . expect
3
3
const request = require ( 'supertest' )
4
- const fastGateway = require ( './. ./index' )
4
+ const fastGateway = require ( '../index' )
5
5
const config = require ( './config' )
6
6
7
7
let remote , gateway
@@ -303,6 +303,14 @@ describe('API Gateway', () => {
303
303
} )
304
304
} )
305
305
306
+ it ( 'GET /lambda/hi' , async ( ) => {
307
+ await request ( gateway )
308
+ . get ( '/lambda/hi' )
309
+ . then ( ( res ) => {
310
+ expect ( res . text ) . to . equal ( 'Go Serverless!' )
311
+ } )
312
+ } )
313
+
306
314
it ( 'close' , async function ( ) {
307
315
this . timeout ( 10 * 1000 )
308
316
You can’t perform that action at this time.
0 commit comments