UNPKG

serverless

Version:

Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more

17 lines (12 loc) 411 B
'use strict'; const fetch = require('node-fetch'); const BbPromise = require('bluebird'); function eventGatewayRunning(eventGatewayRootUrl) { const eventGatewayStatusEndpoint = `${eventGatewayRootUrl}/v1/status`; return fetch(eventGatewayStatusEndpoint, { method: 'GET', timeout: 1000, }).then(res => res.ok) .catch(() => BbPromise.resolve(false)); } module.exports = eventGatewayRunning;