import { Container } from '@brainhubeu/hadron-core' ; import { princesses } from '../unicorns-and-princesses' ; import { ISerializer } from '@brainhubeu/hadron-serialization' ; Container . register ( 'princesses' , princesses ) ; export default { getPrincess : { path : '/princesses/:name' , callback : ( { params } , { princesses } ) => { return { body : princesses [ params . name ] , } ; } , methods : [ 'get' ] , } , getPrincessWithRole : { path : '/princesses/:role/:name' , callback : ( { params } , { princesses , serializer } ) => { return { body : serializer . serialize ( princesses [ params . name ] , [ params . role ] , 'Princess' ) , } ; } , methods : [ 'get' ] , } , getPrincessWithRoleAndSerializer : { path : '/princesses/:role/:name' , callback : ( { params } , { princesses , princessSerializer } ) => { return { body : princessSerializer ( princesses [ params . name ] , [ params . role ] ) , } ; } , methods : [ 'get' ] , } , } ;