Does anybody knows how to write an API inside a Truffle application?
No, Truffle is not a framework for APIs.
It is a wrapper around a
smart-contract which enables the methods defined in
But you can.
Since it is like a node app, you can use any node.js modules to make it work as an API endpoint using