Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: