6 ms·
You can do what you are looking for with AppJet.jar. It has a built-in RESTful dispatcher. In your example you would write a JavaScript function like: func
by js4all 15y ago
You can do what you are looking for with AppJet.jar. It has a built-in RESTful dispatcher. In your example you would write a JavaScript function like:
function get_c() {
if (request.params.p == '0')
print 'abc';
if (request.params.p == '1')
print '123';
if (request.params.p == '0')
print ...;
You can also respond to POST, PUT and DELETE request with put_c(), delete_c() and so on.
It is a setup-free server in a jar with a persistent object store and many more tools. https://github.com/dvbportal/appjet https://github.com/dvbportal/appjet