File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
examples/extend-express-app Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ export default config<TypeInfo>({
2323 // this example HTTP GET handler retrieves any posts in the database for your context
2424 // with an optional request query parameter of `draft=1`
2525 // returning them as JSON
26+ //
27+ // e.g
28+ // http://localhost:3000/rest/posts
29+ // http://localhost:3000/rest/posts?draft=1
30+ //
2631 app . get ( '/rest/posts' , async ( req , res ) => {
2732 const context = await commonContext . withRequest ( req , res )
2833 // if (!context.session) return res.status(401).end()
@@ -46,6 +51,9 @@ export default config<TypeInfo>({
4651 } ,
4752
4853 extendHttpServer : ( server , commonContext ) => {
54+ // e.g
55+ // http://localhost:3000/rest/posts/clu7x6ch90002a89s6l63bjb5
56+ //
4957 server . on ( 'request' , async ( req , res ) => {
5058 if ( ! req . url ?. startsWith ( '/rest/posts/' ) ) return
5159
You can’t perform that action at this time.
0 commit comments