Skip to content

Commit

Permalink
Merge pull request #13 from teunmooij/master
Browse files Browse the repository at this point in the history
chore: dependency and typedef updates
  • Loading branch information
Betisman authored Sep 14, 2022
2 parents facf9ca + d2ac3f0 commit 98cc238
Show file tree
Hide file tree
Showing 4 changed files with 517 additions and 551 deletions.
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

0 comments on commit 98cc238

Please sign in to comment.