Jonatan Nilsson
68eef3a6b6
Removed large amount of dependencies. Added vips support and automatically resizing based on any criteria. Faster and leaner. Added ability to fetch listing of files in folders.
43 lines
747 B
JavaScript
43 lines
747 B
JavaScript
import { stub } from 'eltro'
|
|
import Client from './helper.client.mjs'
|
|
import defaults from '../api/defaults.mjs'
|
|
import serv from '../api/server.mjs'
|
|
|
|
serv.log = {
|
|
log: stub(),
|
|
warn: stub(),
|
|
info: stub(),
|
|
error: stub(),
|
|
child: stub(),
|
|
}
|
|
|
|
serv.log.child.returns(serv.log)
|
|
|
|
export const server = serv
|
|
|
|
export function createClient() {
|
|
return new Client()
|
|
}
|
|
|
|
export function resetLog() {
|
|
serv.log.log.reset()
|
|
serv.log.info.reset()
|
|
serv.log.warn.reset()
|
|
serv.log.error.reset()
|
|
}
|
|
|
|
export function createContext(opts) {
|
|
return defaults(opts, {
|
|
query: new Map(),
|
|
params: { },
|
|
req: { },
|
|
res: { },
|
|
state: {},
|
|
log: {
|
|
log: stub(),
|
|
warn: stub(),
|
|
info: stub(),
|
|
error: stub(),
|
|
},
|
|
})
|
|
}
|