Skip to content

A basic example of Simplicite REST services using Ajax

Notifications You must be signed in to change notification settings

simplicitesoftware/ajax-demo

Repository files navigation

Simplicité Software


Ajax web frontend demo

Quality Gate Status

This project is a very basic web front-end demo written in a single HTML page (including jQuery® and Bootstrap®) using the Simplicité® REST services.

The file to use is index.html

If you want to use your own Simplicité® instance you just need to adjust the root URL in the root variable to point to your instance's base API URL (typically http[s]://<my host>/[<mycontextroot>]/api)

Some other very basic examples are provided:

  • xhr-example.html: simple call to the user data REST service using the standard XMLHttpRequest API
  • fetch-example.html: simple call to the user data REST service using the standard fetch API
  • ajaxlib-example.html: same example as above but using the instance's Ajax library
  • jslib-example.html: same example as above but using the Simplicité JS client library

Authentication method

The auth token-based authentication method used in the index.html file is the recommended approach:

  • First call to the /api/login endpoint to obtain an auth token by posting login and password as a basic auth string header.
  • Then use the obtained auth token for all subsequent calls to REST services using the custom X-Simplicite-Authorization HTTP header with Bearer <auth token> as value

License

Copyright 2016-2022 Simplicité Software

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A basic example of Simplicite REST services using Ajax

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages