pushup icon indicating copy to clipboard operation
pushup copied to clipboard

Demonstrate using a Pushup app as a library in another Go app

Open paulsmith opened this issue 2 years ago • 1 comments

In docs and blog posts we talk about how Pushup apps can be easily incorporated into a larger Go app. This is because:

  • Pushup apps are compiled down to a Go package
  • Pushup pages implement an interface that is very similar to http.Handler (see #81)
  • Pushup apps are built by routing to pages via a http.ServeMux

But to my knowledge we haven't actually demonstrated this yet. Also it would likely require a bit of clunky manual manipulation on the other Go app's part because some of the Pushup behavior is wrapped up in its main package and not exposed as a library/package API.

This would force us to do the work of actually glueing these things together, which will likely flush out some bugs or point to whether additional code is needed.

paulsmith avatar Jan 12 '23 16:01 paulsmith

Hey @paulsmith, just found this awesome library, it covers most of what I wanted from a base project, coming from django/rails projects. I'm developing a gofiber app at work and personally played around with chi & echo, so I could easily come up with a contribution to this issue, if that's something appreciated. Just let me know and I'll give you a PR for that.

bastianwegge avatar Mar 10 '24 13:03 bastianwegge