Backend for sphinx tribes and bounties. The bounty platform pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
As part of implementing the Stakwork workflow plumbing system, we need to add a new route to handle workflow requests.
Technical Details
Add route: POST /workflows/request
Route should map to the workflow request handler
Part of the workflow request processing implementation (#parent_ticket)
Route Setup
// In routes/workflow_routes.go
// We'll need to add a new route for workflow requests
func SetupWorkflowRoutes(r *gin.Engine) {
workflows := r.Group("/workflows")
{
workflows.POST("/request", handlers.HandleWorkflowRequest)
}
}
Example Route Test
// In routes/workflow_routes_test.go
// We'll need to verify route registration and basic connectivity
func TestWorkflowRoutes(t *testing.T) {
router := gin.New()
SetupWorkflowRoutes(router)
// Test POST request
w := httptest.NewRecorder()
req := httptest.NewRequest("POST", "/workflows/request", nil)
router.ServeHTTP(w, req)
// Should get 400 because no body (not 404)
assert.NotEqual(t, 404, w.Code)
}
Notes for Implementer
Use existing router setup pattern from other routes
Ensure route is added to main router initialization
Consider adding request rate limiting later
Route will initially return 501 Not Implemented until handler is ready
Tasks
[ ] Add route in /routes/workflow_routes.go
[ ] Register route with main router
[ ] Add route tests
[ ] Update router documentation
Acceptance Criteria
[ ] Route correctly maps POST requests to /workflows/request
[ ] Route tests verify endpoint availability
[ ] Route is properly documented in API documentation
Context
As part of implementing the Stakwork workflow plumbing system, we need to add a new route to handle workflow requests.
Technical Details
/workflows/request
Example Route Test
Notes for Implementer
Tasks
/routes/workflow_routes.go
Acceptance Criteria
/workflows/request
Dependencies