Skip to content

Commit

Permalink
fix(herbsshelf): fix herbarium link with herbsshelf
Browse files Browse the repository at this point in the history
  • Loading branch information
dalssoft committed Feb 19, 2022
1 parent 939cc21 commit 757c131
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/templates/infra/api/server.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ const { herbarium } = require('@herbsjs/herbarium')
<% if(props.rest) {%>const { rest } = require('./rest')<% }%>

function herbsshelf(app, config) {
const usecases = Array.from(herbarium.usecases.all).map(([_, item]) =>
({ usecase: item.usecase(), id: item.id, tags: { group: item.group } }))

app.get('/herbsshelf', (_, res) => {
res.setHeader('Content-Type', 'text/html')
const shelf = renderShelfHTML('Project generated by Herbs-CLI', ucs)
const shelf = renderShelfHTML('<%- props.name %>', usecases)
res.write(shelf)
res.end()
})
Expand Down

0 comments on commit 757c131

Please sign in to comment.