@naturalcycles/backend-lib
Advanced tools
Comparing version 1.14.0 to 1.14.1
@@ -0,1 +1,8 @@ | ||
## [1.14.1](https://github.com/NaturalCycles/backend-lib/compare/v1.14.0...v1.14.1) (2019-07-18) | ||
### Bug Fixes | ||
* createRootHandler ([91466b3](https://github.com/NaturalCycles/backend-lib/commit/91466b3)) | ||
# [1.14.0](https://github.com/NaturalCycles/backend-lib/compare/v1.13.1...v1.14.0) (2019-07-17) | ||
@@ -2,0 +9,0 @@ |
import { RequestHandler } from 'express'; | ||
interface ServerStartedContainer { | ||
/** | ||
* Unix timestamp in millis | ||
*/ | ||
serverStarted?: number; | ||
} | ||
export declare function createRootHandler(serverStartedContainer: ServerStartedContainer, extra?: any): RequestHandler; | ||
/** | ||
* @returns unix timestamp in millis | ||
*/ | ||
declare type ServerStartedCallback = () => number | undefined; | ||
export declare function createRootHandler(serverStartedCallback: ServerStartedCallback, extra?: any): RequestHandler; | ||
export {}; |
@@ -6,7 +6,7 @@ "use strict"; | ||
const time_lib_1 = require("@naturalcycles/time-lib"); | ||
function createRootHandler(serverStartedContainer, extra) { | ||
function createRootHandler(serverStartedCallback, extra) { | ||
const { APP_ENV } = process.env; | ||
return async (req, res) => { | ||
res.json(js_lib_1.filterFalsyValues({ | ||
started: getStartedStr(serverStartedContainer.serverStarted), | ||
started: getStartedStr(serverStartedCallback()), | ||
APP_ENV, | ||
@@ -13,0 +13,0 @@ mem: nodejs_lib_1.processSharedUtil.memoryUsage(), |
{ | ||
"name": "@naturalcycles/backend-lib", | ||
"version": "1.14.0", | ||
"version": "1.14.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "deploy-gae": "yarn tsn ./src/bin/deploy-gae.ts", |
@@ -6,11 +6,9 @@ import { filterFalsyValues } from '@naturalcycles/js-lib' | ||
interface ServerStartedContainer { | ||
/** | ||
* Unix timestamp in millis | ||
*/ | ||
serverStarted?: number | ||
} | ||
/** | ||
* @returns unix timestamp in millis | ||
*/ | ||
type ServerStartedCallback = () => number | undefined | ||
export function createRootHandler ( | ||
serverStartedContainer: ServerStartedContainer, | ||
serverStartedCallback: ServerStartedCallback, | ||
extra?: any, | ||
@@ -23,3 +21,3 @@ ): RequestHandler { | ||
filterFalsyValues({ | ||
started: getStartedStr(serverStartedContainer.serverStarted), | ||
started: getStartedStr(serverStartedCallback()), | ||
APP_ENV, | ||
@@ -26,0 +24,0 @@ mem: processSharedUtil.memoryUsage(), |
Sorry, the diff of this file is not supported yet
104964
2061