Page 1 of 1

Multiple Copies of Self Hosted Web API

PostPosted: Tue Sep 26, 2017 9:10 am
by SBarnes
Hi Mike,

Is there a way to run multiple copies of the Self Hosted Web API on the same machine that would talk to different databases i.e would the following work?


    1 .Copy the Jiwa Program Directory.
    2. Use install util to register a second version of the service
    3. Configure both config files accordingly
    4. Start both services

Re: Multiple Copies of Self Hosted Web API  Topic is solved

PostPosted: Thu Sep 28, 2017 2:25 pm
by Mike.Sheen
Yes.

We have some guidance on how to do this for the plugin scheduler service, and the same would apply to this.

Re: Multiple Copies of Self Hosted Web API

PostPosted: Thu Sep 28, 2017 2:28 pm
by Mike.Sheen
You're going to ask next for a way to limit which IJiwaRESTAPI plugin classes are loaded / exposed per service, aren't you! :o

Re: Multiple Copies of Self Hosted Web API

PostPosted: Thu Sep 28, 2017 2:33 pm
by SBarnes
Ah actually I wasn't because I was actually thinking inter-company communication i.e. two separate databases but now that you've so kindly volunteered to tell me there must obviously be a way? :lol:

Re: Multiple Copies of Self Hosted Web API

PostPosted: Thu Sep 28, 2017 5:53 pm
by Mike.Sheen
For multiple services hitting the same database, you could look at Assembly.GetExecutingAssembly().Location to reveal the file location of the service, then selectively add routes in the plugin based on that.

I've done this before with the Plugin Scheduler, before we had the ability to limit which plugins are executed via the config - so it should work also for the REST API self-hosted service. Not sure how to do this with IIS/App Service - probably there is a way to limit based on base URL.

Re: Multiple Copies of Self Hosted Web API

PostPosted: Thu Sep 28, 2017 6:06 pm
by SBarnes
The only other way I could think of would be to have different users /user groups and permissions for the paths through the user interface.