November Happy Hour will be moved to Thursday December 5th.

REST API controllers into existing EPiServer CMS website

Vote:
 

Hi Team,

I have created couple of custom tables into CMS database to meet the client business requirements and which is hosted in Episerver DXC.

Now, Our client has a requirement to build couple of REST Apis to expose and perform CRUD operations onto custom tables which are created in CMS database.

I am planning to create Api controllers within same cms website to meet our client requirements.

So, here i need couple of suggestions to proceed further on this.

1) Do i get any routing conflicts, If i include Api controllers into same cms website?

2) Do i need take care of any additional configurations to make it REST api works in existing episerver cms website?

3) Anyone came across this scenario? Could anyone please share some references to get better understanding on this approach?

Please let me know any suggestions on this.

Thanks,

Suresh B

#223963
Jun 08, 2020 18:16
Vote:
 

1) Do i get any routing conflicts, If i include Api controllers into same cms website?

If you properly register your API controllers with proper routes, you should be fine.

2) Do i need take care of any additional configurations to make it REST api works in existing episerver cms website?

3) Anyone came across this scenario? Could anyone please share some references to get better understanding on this approach?

If you want to make proper use of Dependency Injection in your API controllers, there are some steps you need to follow to make that work.

Here is a very good and detailed post: https://swapcode.wordpress.com/2019/12/07/dependency-injection-with-episerver-cms-and-web-api/ - works fine for me.

Here is also a good post covering lot of information:

https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2018/5/cant-get-web-api-to-work-in-episerver-/

#223997
Jun 09, 2020 9:16
Vote:
 

Hi Jerzy,

Thanks for the update.

I have managed to integrate Apis into episerver cms solution. Its all good now.

Thanks,

Suresh B

#224387
Jun 18, 2020 9:07
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.