Closed
Description
I'm not an expert with javascript. Below is how I did it.
expected output: .svg or .png file that I can show on the response as full path.
Please help. thanks.
const express = require('express');
const mermaidAPI = require('mermaid');
app.get('/chart', (req, res) => {
mermaidAPI.initialize({
startOnLoad: true
})
const graphDefinition = 'graph TB\na-->b'
const cb = function(svgGraph) {
console.log(svgGraph)
}
mermaidAPI.render('id1',graphDefinition,cb)
res.status(200).json('.svg or .png file path here!');
})
Metadata
Metadata
Assignees
Labels
No labels