Closed benjaoming closed 2 years ago
Hi Ben thank you for using my project.
Try the following
:8080 {
@api {
path /api/*
}
route @api {
uri strip_prefix /api
reverse_proxy {
to localhost:3000
}
openapi {
spec ./customer.yaml
policy_bundle ../policy/bundle.tar.gz
check {
req_body
resp_body
}
log_error
}
}
handle_errors {
respond @api "Resource: {http.request.orig_uri}. Error: {openapi.error}" {openapi.status_code} {
close
}
}
}
Remove all /api
references from your OAS spec and your code.
HTH
Thanks for an amazing project! Very useful for bootstrapping new API-driven projects!
Looking at how specifications are conventionally done, they don't include for instance
/api/v1
or/api/ in their
path` components.Is it possible to write a configuration where the specification is nested inside
/some/path/*
but/some/path/*
does not have to be written into thepaths
of the specification file?(I tried to work around this, but couldn't find a way)