Welcome Guest, Not a member yet? Register   Sign In
CI as a REST API?
#1

I am coding a REST API using the SLIM Framework. 

I am about 30% done of the first cut of the API.

But .... I am finding it a hard slog and I know CI so much better.

Has anyone used CI as a REST API?

I know CI could do this job by my real question should  it do it?

Or should I just suck it up and get the Slim thing working? 

Any guidance from experienced folks with strong opinions is welcome!
Reply
#2

(This post was last modified: 10-09-2015, 03:42 PM by orionstar.)

I am using a CodeIgniter controller base class called REST_Controller to create APIs. Check out:
https://github.com/chriskacerguis/codeig...restserver

It was originally created by Phil Sturgeon, he write some blog post about it for example:
https://philsturgeon.uk/codeigniter/2009...deIgniter/
Reply
#3

(10-09-2015, 03:37 PM)orionstar Wrote: I am using a CodeIgniter controller base class called REST_Controller to create APIs. Check out:
https://github.com/chriskacerguis/codeig...restserver

That is really really exciting and pretty much exactly what I am looking for.

Have you noticed any speed problems?
Reply
#4

I have a pretty old version of this controller in my CMS, maybe 2-3 years old one, so I don't have experience with the current content of the repository. With the old one, we never had performance or any kind of problem in the last ~3-4 years or so...
Reply
#5

Many thanks orionstar.

If it is easier to code for me and performance is not an issue I'm happy enough!
Reply
#6

CodeIgniter is not yet suitable for building REST services and a package can only do so much. I'd stick with Slim for that task.

Easy (and you really mean "familiar" here instead) != Proper.
Reply
#7

(This post was last modified: 10-09-2015, 05:20 PM by orionstar.)

(10-09-2015, 04:50 PM)Narf Wrote: CodeIgniter is not yet suitable for building REST services and a package can only do so much. I'd stick with Slim for that task.

Easy (and you really mean "familiar" here instead) != Proper.

Can you explain what is the "proper" way? Is it really matter, a feature supported out-of-box or with a library?!
Reply
#8

(10-09-2015, 04:50 PM)Narf Wrote: CodeIgniter is not yet suitable for building REST services and a package can only do so much. I'd stick with Slim for that task.

Easy (and you really mean "familiar" here instead) != Proper.

What makes CI not suitable for REST services?

(and yes famililar != proper  - I agree!)
Reply
#9

It's not a matter of whether you use an external library or a built-in one, CI is just made for web pages and doesn't give you control over low-level HTTP functionalities.
Reply
#10

(10-10-2015, 02:29 AM)Narf Wrote: It's not a matter of whether you use an external library or a built-in one, CI is just made for web pages and doesn't give you control over low-level HTTP functionalities.

I've been using CI as API Rest and I'm very happy with it.

I'm curious about the low-level HTTP functionalities you mention.

Off topic: This is my first post in the forum Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB