chialab / math-api Goto Github PK
View Code? Open in Web Editor NEW➗ Serverless API to render maths using MathJax for Node.
License: MIT License
➗ Serverless API to render maths using MathJax for Node.
License: MIT License
I get the following error when I execute the sample POST request provided, in POSTMAN:
{ "message": "Unexpected token u in JSON at position 0" }
Request:
POST /render HTTP/1.1
Host: localhost:3000
Accept: image/svg+xml
Content-Type: application/json
User-Agent: PostmanRuntime/7.15.0
Cache-Control: no-cache
Postman-Token: 2971d956-b4a9-43df-90d6-1d690b16c83f,d6ca15e5-1546-48c6-a7ec-04662a8d0286
Host: localhost:3000
accept-encoding: gzip, deflate
content-length: 60
Connection: keep-alive
cache-control: no-cache{
"input": "latex",
"output": "svg",
"source": "x^2"
}
I searched around and it seems that the 'u' in because 'undefined' is being returned. Can I print the entire debug message to see what's going wrong?
render?input=latex&inline=1&output=png&source=(3+x)&width=512
the "+" of "(3+x)" expression can't be rendered.
I'm suggesting to add a parameter for changing the output text color (default: black). Maybe forcing a background color (instead of transparency) for png outputs could also be a useful option.
I mainly use a self-hosted math-api instance for quickly typing out formulas in chats that don't have native LaTeX rendering or a bot that can do that. Most online chat platforms render links to images directly as inline images in chat.
The discord mobile app offers a "super dark" oled theme with an all-black background. For users of the app, transparent PNGs with black text will just appear as an endless void.
I get this error from AWS:
Error occurred while GetObject. S3 Error Code: PermanentRedirect. S3 Error Message: The bucket is in this region: eu-west-1. Please use this region to retry the request (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 98fee368-384d-4ea6-8e39-e32cac3e5803)
I'm trying to create the stack in the us-east-1 region.
@fquffio any thoughts?
As GitHub Actions have become available more than a year ago, we would rather migrate our CI/CD workflow here and dismiss Travis CI.
We should probably also consider uploading the artifacts to more AWS regions… 🤔
using as runtime node from version 10 (since nodejs8.10
cannot be used anymore) trying converting to PNG produces the following error:
{
"errorType": "Error",
"errorMessage": "write EPIPE",
"code": "EPIPE",
"errno": "EPIPE",
"syscall": "write",
"stack": [
"Error: write EPIPE",
" at afterWriteDispatched (internal/stream_base_commons.js:156:25)",
" at writevGeneric (internal/stream_base_commons.js:139:3)",
" at Socket._writeGeneric (net.js:785:11)",
" at Socket._writev (net.js:794:8)",
" at doWrite (_stream_writable.js:401:12)",
" at clearBuffer (_stream_writable.js:519:5)",
" at Socket.Writable.uncork (_stream_writable.js:338:7)",
" at Socket.Writable.end (_stream_writable.js:590:10)",
" at Socket.end (net.js:591:31)",
" at writeBufferInChunks (/opt/nodejs/node_modules/svg2png/lib/svg2png.js:54:20)"
]
}
This seems to be a problem linked with PhantomJS (dependency of svg2png
), which can no longer be used directly in the Lambda environment as some system dependencies have been removed from the newer runtimes (eg. fontconfig
)
In order to fix the problem an extra layer could be created to add the missing libs ( https://github.com/naeemshaikh27/phantom-lambda-fontconfig-pack ) or maybe the function body could be defined as container image
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.