mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
28 lines
722 B
JavaScript
28 lines
722 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* JAWS Services: AWS: API Gateway
|
|
* - Prefix custom methods with "s"
|
|
*/
|
|
|
|
let BbPromise = require('bluebird'),
|
|
path = require('path'),
|
|
os = require('os'),
|
|
AWS = require('aws-sdk'),
|
|
JawsError = require('../../jaws-error'),
|
|
JawsUtils = require('../../utils'),
|
|
async = require('async'),
|
|
fs = require('fs');
|
|
|
|
// Promisify fs module. This adds "Async" to the end of every method
|
|
BbPromise.promisifyAll(fs);
|
|
|
|
module.exports = function(config) {
|
|
|
|
// Promisify and configure instance
|
|
const ApiGateway = BbPromise.promisifyAll(new AWS.APIGateway(config), { suffix: "Promised" });
|
|
|
|
// Return configured, customized instance
|
|
return ApiGateway;
|
|
|
|
}; |