• Stars
    star
    11
  • Rank 1,694,829 (Top 34 %)
  • Language
    Ada
  • License
    GNU General Publi...
  • Created almost 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Embedded Web Server is designed for use in embedded systems with limited resources (eg, no disk). It supports both static (converted from a standard web tree, including graphics and Java class files) and dynamic pages. It is written in GCC Ada.

Embedded Web Server

Introduction

EWS is a web server construction kit, designed for embedded applications using the GNAT Ada compiler.

The project is hosted on Github.

Building with Alire

See the Alire documentation.

After you've installed Alire, start a small test program by saying

alr init --bin ews_test
cd ews_test
alr with ews

This generates a project (GPR) file at the top level and a source file src/ews_test.adb.

Create a directory html and in it index.html containing (for example)

<html>
<body>
<font color="red">Hello world!</font>
</body>
</html>

The contents of html/ need to be converted to Ada source code in src/, which will form the static content of the pages served by ews_test. This can be done as part of the Alire build process; to do this, edit alire.toml to add the lines

[[actions]]
type = "pre-build"
command = ["ews_generator", "--input-dir", "html", "--output-dir", "src"]

Edit the contents of src/ews_test.adb to contain

with EWS_Htdocs;
with EWS.Server;
procedure EWS_Test is
begin
   EWS.Server.Serve (Using_Port => 8088,
                     Tracing    => True);
end EWS_Test;

and build and run with

alr run

Now, in your browser, open localhost:8088 (possibly, 127.0.0.1:8088) to see your exciting web page!

To see a worked example of dynamic content, check out the document ews.pdf.

Building outside Alire

EWS requires GNAT and XML/Ada, and uses Ada 2012 features.

In the top-level directory, make will build the library, and make demo will create a server doc/ews_demo, which when executed will listen on port 8080 and respond with the web in the doc/ directory.

The package can be installed with the compiler by make install (more likely, sudo make install). You can install in an alternative place by setting prefix, for example

$ make install prefix=~/local/ews

Dynamic web

The facilities available in EWS, and the code for a demonstration, are described in demonstrator/ews.pdf, which is derived from demonstrator/ews.w. As well as being the document source, ews.w also acts as the source code using the Literate Programming facilities of nuweb.py.

Demonstration

If you're seeing this page via the demonstration (ews_demo), you can view a page with AJAX content here.

More Repositories

1

cortex-gnat-rts

This project contains various GNAT Ada Run Time Systems (RTSs) targeted at Cortex boards: so far, the Arduino Due, the STM32F4-series evaluation boards from STMicroelectronics, and the BBC micro:bit (v1)
Ada
60
star
2

distributing-gcc

Binary releases of GCC (native and cross) on macOS; also, the scripts/Makefiles used for producing them.
Makefile
32
star
3

building-gcc-macos-native

Scripts for building GCC on macOS
Shell
11
star
4

stack_usage

Calculates the maximum stack depth required by GCC-compiled code
Python
10
star
5

analytical-engine

An Ada 2012 emulation of Charles Babbage’s Analytical Engine
Ada
9
star
6

ACATS

The Ada Conformity Assessment Test Suite, customised for GCC.
Ada
9
star
7

tcladashell

Ada binding to Tcl/Tk. Note, the copyright is GPL 2.0 + GMGPL
Ada
9
star
8

ASIS

Supports building the Ada Semantic Interface Specification library and tools for FSF GCC variants. Tracks AdaCore CE releases.
Ada
8
star
9

coldframe

ColdFrame generates Ada framework code and documentation from UML models.
Ada
8
star
10

nuweb.py

Literate programming in LaTeX; programming languages of your choice
Python
5
star
11

xia

An Ada implementation of XPath 1.0.
Ada
4
star
12

dhondt

Ada implementation of D’Hondt electoral result calculator
Ada
4
star
13

alire-index.mac

Index of Alire crate versions catering for macOS idiosyncrasies
4
star
14

building-gcc-macos-arm-eabi

Scripts for building GCC on macOS as a cross-compiler to arm-eabi
Shell
3
star
15

adagoop

Generator of object-oriented parsers in Ada
Ada
3
star
16

libadalang2xml

Generates an XML representation of Ada source using libadalang.
Ada
2
star
17

asis2xml

Converts Ada sources’ ASIS representation to XML, so as to make it easier to develop reporting and transformational tools using (for example) XSLT.
Ada
2
star
18

leak_detector

Reports memory leaks in Ada programs.
Ada
2
star
19

xcode_15_fix

Xcode/CLT version 15 introduced problems for Ada programming on macOS.
Ada
2
star
20

Quaternions

An Ada library to support using quaternions.
Ada
2
star
21

macos-sdks-vs-gcc

Provides GCC 'specs' files to cope with macOS SDK policy changes
Ada
1
star
22

synchronized_output

Supports text logging from multiple tasks
Ada
1
star
23

gnat_util

Provides access to GNAT compiler internals for AdaCore utilities
Makefile
1
star
24

scripted_testing

Supports functional testing using Tcl scripts.
Ada
1
star
25

ACATS-grading

Tools for grading ACATS results, modified for Unix-like systems
Shell
1
star
26

minimal_containers

Just enough containers for ColdFrame.
Ada
1
star
27

trace_utilities

Support for presenting traceback information.
Ada
1
star
28

parallelize

Reads commands and executes them in parallel.
Ada
1
star