Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: dependency and typedef updates #13

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from 'systemic'
import { CallbackComponent } from 'systemic'
import { ErrorRequestHandler, Express, RequestHandler } from 'express'

export type AppConfig = {
Expand All @@ -24,17 +24,17 @@ export type MiddleWareConfig = {
* Systemic component that creates and configures an Express app
* @param options optionally a function that creates a basic Express app can be passed into the component
*/
export function app(options?: { express?: () => Express }): Component<Express, { config?: AppConfig; logger?: any }>
export function app(options?: { express?: () => Express }): CallbackComponent<Express, { config?: AppConfig; logger?: any }>

/**
* Starts the Express server
*/
export function server(): Component<void, { config: ServerConfig; app: Express; logger?: any }>
export function server(): CallbackComponent<void, { config: ServerConfig; app: Express; logger?: any }>

/**
* Adds default notFound and error middleware to the app
* @param options Custom notfound and error middleware can be passed in. If omitted default middleware will be used.
*/
export function defaultMiddleware(
options?: MiddlewareOptions,
): Component<void, { config?: MiddleWareConfig; app: Express; logger?: any }>
): CallbackComponent<void, { config?: MiddleWareConfig; app: Express; logger?: any }>
3 changes: 1 addition & 2 deletions lib/default-middleware.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
var async = require('async')
var get = require('lodash.get')
var has = require('lodash.has')
var merge = require('lodash.merge')
var xml = require('jsontoxml')
var Boom = require('boom')
var Boom = require('@hapi/boom')
var format = require('util').format

module.exports = function(options) {
Expand Down
Loading