Skip to content

Commit ffe731e

Browse files
committed
README and such
...
1 parent 7a63ae9 commit ffe731e

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

Sources/httpd-helloworld/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<h2>Macro.swift httpd-helloworld
2+
<img src="http://zeezide.com/img/MicroExpressIcon1024.png"
3+
align="right" width="100" height="100" />
4+
</h2>
5+
6+
Demonstrates the use of the basic `http` module.
7+
That doesn't feature any middleware or such, but
8+
just the basic request/response mechanism.
9+
10+
The server take a client request and returns an HTML response
11+
with some information about the submitted request.
12+
13+
Like in Node, IncomingMessage and ServerResponse
14+
are regular streams.
15+
16+
## Running the Sample
17+
18+
If you have
19+
[swift-sh](https://github.com/mxcl/swift-sh)
20+
installed (`brew install swift-sh`),
21+
just starting the main.swift file works:
22+
```
23+
$ Sources/httpd-helloworld/main.swift
24+
2020-01-07T17:14:35+0100 notice: Server listening on http://localhost:1337/
25+
```
26+
27+
Or you can use `swift run` w/o installing additional software:
28+
```
29+
$ swift run httpd-helloworld
30+
2020-01-07T21:37:05+0100 notice: Server listening on http://localhost:1337/
31+
```
32+
33+
### Who
34+
35+
**Macro** is brought to you by
36+
the
37+
[Always Right Institute](http://www.alwaysrightinstitute.com)
38+
and
39+
[ZeeZide](http://zeezide.de).
40+
We like
41+
[feedback](https://twitter.com/ar_institute),
42+
GitHub stars,
43+
cool [contract work](http://zeezide.com/en/services/services.html),
44+
presumably any form of praise you can think of.
45+
46+
There is a `#microexpress` channel on the
47+
[Noze.io Slack](http://slack.noze.io/). Feel free to join!

Sources/httpd-helloworld/main.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/swift sh
22

3-
// httpd-helloworld - the most basic HTTP server
4-
53
import Macro // @Macro-swift ~> 0.0.2
64

75
http.createServer { req, res in

0 commit comments

Comments
 (0)