Skip to content

Commit

Permalink
Merge pull request #65 from NLESC-JCER/section-images
Browse files Browse the repository at this point in the history
Added section images
  • Loading branch information
jspaaks authored Jun 8, 2020
2 parents f4db634 + b78f307 commit 39a767c
Show file tree
Hide file tree
Showing 12 changed files with 764 additions and 17 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ And a valid document:

## CGI script

![cgi](images/cgi.svg.png "CGI")

The classic way to run programs when accessing a url is to use the Common Gateway Interface (CGI).
In the [Apache httpd web server](https://httpd.apache.org/docs/2.4/howto/cgi.html) you can configure a directory as a ScriptAlias, when visiting a file inside that directory the file will be executed.
The executable can read the request body from the stdin for and the response must be printed to the stdout.
Expand Down Expand Up @@ -312,6 +314,8 @@ The problem with CGI scripts is when the program does some initialization, you h

## Web framework

![flask](images/flask.svg.png "Flask")

A web framework is an abstraction layer for making web applications. It takes care of mapping a request on a certain url to a user defined function. And mapping the return of a user defined function to a response like an HTML page or an error message.

## Python
Expand Down Expand Up @@ -595,6 +599,8 @@ docker stop some-redis
### Web service
![swagger](images/swagger.svg.png "Swagger")
A web application is meant for consumption by humans and web service is meant for consumption by machines or other programs.
So instead of returning HTML pages a web service will accept and return machine readable documents like JSON documents. A web service is an application programming interface (API) based on web technologies.
Expand Down Expand Up @@ -709,6 +715,8 @@ curl -X POST "http://localhost:8080/api/newtonraphson" -H "accept: application/j

## JavaScript

![wasm](images/wasm.svg.png "WebAssembly")

JavaScript is the de facto programming language for web browsers.
The JavaScript engine in the Chrome browser called V8 has been wrapped in a runtime engine called Node.js which can execute JavaScript code outside the browser.

Expand Down Expand Up @@ -927,6 +935,8 @@ The result of root finding was calculated using the C++ algorithm compiled to a

## Single page application

![react](images/react.svg.png "React")

In the [Web application](#web-application) section, a common approach is to render an entire HTML page even if a subset of elements requires a change. With the advances in the web browser (JavaScript) engines including methods to fetch JSON documents from a web service, it has become possible to address this shortcoming. The so-called [Single Page Applications](https://en.wikipedia.org/wiki/Single-page_application) (SPA) enable changes to be made in a part of the page without rendering the entire page. To ease SPA development, a number of frameworks have been developed. The most popular front-end web frameworks are (as of July 2019):

- [React](https://reactjs.org/)
Expand Down Expand Up @@ -1239,16 +1249,6 @@ The form [by default](https://react-jsonschema-form.readthedocs.io/en/latest/usa
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
```

The react-jsonschema-form component normally renders an integer with a updown selector. To use a range slider instead configure a [user interface schema](https://react-jsonschema-form.readthedocs.io/en/latest/quickstart/#form-uischema).

```{.js #jsonschema-app}
const uiSchema = {
"guess": {
"ui:widget": "range"
}
}
```

The values in the form must be initialized and updated whenever the form changes.

```{.js #jsonschema-app}
Expand All @@ -1268,7 +1268,6 @@ The form can be rendered with
```{.jsx #jsonschema-form}
{ /* this JavaScript snippet is later referred to as <<jsonschema-form>> */}
<Form
uiSchema={uiSchema}
schema={schema}
formData={formData}
onChange={handleChange}
Expand Down
143 changes: 143 additions & 0 deletions images/cgi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/cgi.svg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 39a767c

Please sign in to comment.