# Modern Web Framework development is possible like Angular or React?

**URL:** <https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349>\
**Category:** YANG\
**Created:** [October 30, 2020, 12:56pm UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349 "2020-10-30T12:56:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivakumar](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sivakumar](https://dmap-community.ductus.global/u/sivakumar)\
**Post date:** [October 30, 2020, 12:56pm UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/1 "2020-10-30T12:56:35Z")

</div>

Hi,

Conf-D Web REST API output will be in HTML template or Yang Model driven or JSON data driven?

If Yang model driven - then is possible to use Angular as Web Frame work for creating UI custom templates to convert Yang model XML response?

Or If Web API returns HTML output also - where we can write only css style.

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [October 30, 2020, 2:57pm UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/2 "2020-10-30T14:57:23Z")

</div>

Hello,

direct REST API is deprecated in current ConfD, and recent full ConfD releases (not included in basic) come with:

- **RESTCONF** for REST-like web-app architecture  
[https://tools.ietf.org/html/rfc8040](https://tools.ietf.org/html/rfc8040)

- **JSON-RPC** for RPC style solution  
[https://www.jsonrpc.org/specification](https://www.jsonrpc.org/specification)

Similarly to a general “problem” of RPC vs REST selection question, both can be used for generic web interface programming, and selection depends on what are your requirements and wanted functionality…

Thanks to these APIs, basically any suitable framework can be picked according to your preferences… ConfD 7.4 comes with new example (`examples.confd/json_rpc/webui`) and shows a limited demo web-ui using JSON-RPC and Vue.JS front-end…

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [October 30, 2020, 3:48pm UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/3 "2020-10-30T15:48:08Z")

</div>

There is a bit more to that:

> [@Can RESTCONF be utilised as backed for Web development](http://dmap-community.ductus.global/t/can-restconf-be-utilised-as-backed-for-web-development/2892/2):
>
> Anything can be done in software, but you would make it difficult for yourself. In summary, the JSON-RPC API focus on WebUI interaction (used by a human being) with ConfD, while the RESTCONF API target REST machine-to-machine point-to-point communication. Just browse the man page for the JSON-RPC API for 5 minutes and you will find things like for example: JSON-RPC support the candidate datastore. RESTCONF does not. (e.g. pre-validate configuration in the candidate before a commit to the run…

---

<div class="post-metadata">

**Author:** ![sivakumar](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sivakumar](https://dmap-community.ductus.global/u/sivakumar)\
**Post date:** [November 2, 2020, 3:18am UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/4 "2020-11-02T03:18:07Z")

</div>

> [@josephm](#):
>
> able framework can be picked according to your preferences… ConfD 7.4 comes with new example ( `examples.confd/json_rpc/webui` )

Thanks,  
So JSON RPC output will be in XML format or JSON ? So it possible to user Angular as web framework ?

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [November 2, 2020, 9:46am UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/5 "2020-11-02T09:46:54Z")

</div>

Hello,

> So JSON RPC output will be in XML format or JSON ?

for RESTCONF, it can be either XML and/or JSON.

For JSON-RPC API, it’s always JSON.

Request to ConfD:

```auto
$ curl http://127.0.0.1:8008/jsonrpc
  -c ./temp.cookie.curl
  -X POST 
  -H 'Content-Type: application/json'
  -d '{"jsonrpc": "2.0","id": 1,"method": "login","params": {"user":"admin","passwd":"admin"}}'

```

Response from ConfD:

```json
{"jsonrpc":"2.0","result":{},"id":1}

```

Some next request:

```auto
$ curl http://127.0.0.1:8008/jsonrpc
  -b ./temp.cookie.curl
  -X POST
  -H 'Content-Type: application/json'
  -d '{"jsonrpc": "2.0","id": 2,"method": "new_trans","params": {}}'

```

and response:

```json
{"jsonrpc":"2.0","result":{"th":1},"id":2}

```

etc.

> So it possible to user Angular as web framework ?

i’m not web-dev professional myself, but imho sure, assuming it fits all customer’s requirements.

ConfD provides only the RESTCONF/JSON-RPC APIs to communicate and exchange data with web-application. it does NOT provides any HTML/styling etc. content. It’s completely up to customer to develop these using any preferred technologies (e.g. Angular, Ract, Vue.js, .or many others) of own choice.

---

<div class="post-metadata">

**Author:** ![sivakumar](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sivakumar](https://dmap-community.ductus.global/u/sivakumar)\
**Post date:** [November 3, 2020, 4:08am UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/6 "2020-11-03T04:08:36Z")

</div>

Thanks for your reply , Also two more question.

Is JSON RPC works with pagination concept ? and also if we have 10000 records and if i would like to retrieve first 200 records with ascending/descending order - is possible ?

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [November 3, 2020, 9:29am UTC](https://dmap-community.ductus.global/t/modern-web-framework-development-is-possible-like-angular-or-react/3349/7 "2020-11-03T09:29:44Z")

</div>

yes, either by direct methods parameter setting, or via customtized query xpaths (where it’s relevant - not for all methods), see ConfD user guide **Chapter “The JSON-RPC API”** that shows all the defined procedures and their parameters / return values etc.

For example generic API method `start_query` allows to define chunk size, sort order, field filtering, etc.
