I
I
invite2012-04-02 12:07:15
Python
invite, 2012-04-02 12:07:15

Website API development

Good afternoon,

there was a need to make an API for an already working site, after writing several methods for the API, the question arose of the correct architecture.

The site is already functioning and there are already methods for generating html / json inside.

Here are the development paths:
- Whether to duplicate the methods in the API, taking into account that further active development of the web is expected
- Whether to integrate with the current web part, simply making wrappers for the API- methods
- Redesign the web part to work directly with the API, in the future only develop the API

What is the best way to do it, perhaps there is a better way than one of these three ways

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bsboris, 2012-04-03
@invite

There is an opinion that a separate set of controllers with a separate base class should be allocated for the API. You can change the structure of the main site as you like and at any time, but third-party programs will be tied to the API, so its external interface should not change.
In order not to duplicate the code - its inclusion in the model and in modules, the code of the controller itself should be minimal.

A
Anatoly, 2012-04-02
@taliban

1. We make an api structure
2. We put calls to existing methods into this structure
3.!!!
4. We rejoice at the working result
...
n. When changing, the structure remains the same, we change the calls of existing methods to a modified and brought to mind version specifically for api.
In general, you are asking strange things:
- Should I duplicate the methods in the API, taking into account that further active development of the web is expected -
Remake the web part for direct work with the API, in the future only develop the API
and do only api. Do you need a website? Or do you just need an API?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question