Skip to content

Commit 1d8d102

Browse files
committed
Move to GitHub CI
1 parent a084d82 commit 1d8d102

File tree

2 files changed

+59
-35
lines changed

2 files changed

+59
-35
lines changed

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Tests
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
name: Node v${{ matrix.node-version }}
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
node-version: [14.x, 16.x, 18.x, 20.x]
14+
15+
steps:
16+
- name: Clone repository
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run tests
29+
run: npm run coverage
30+
31+
- name: Coveralls
32+
uses: coverallsapp/github-action@v2
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
flag-name: node-${{ matrix.node-version }}
36+
parallel: true
37+
38+
finish:
39+
needs: test
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Coveralls
43+
uses: coverallsapp/github-action@v2
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
parallel-finished: true

README.md

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
node-fastcgi
2-
============
1+
# node-fastcgi
32

4-
[![Build Status](https://travis-ci.org/fbbdev/node-fastcgi.svg?branch=master)](https://travis-ci.org/fbbdev/node-fastcgi)
3+
[![Test Status](https://github.com/fbbdev/node-fastcgi/actions/workflows/test.yml/badge.svg)](https://github.com/fbbdev/node-fastcgi/actions/workflows/test.yml)
54
[![Coverage Status](https://coveralls.io/repos/github/fbbdev/node-fastcgi/badge.svg?branch=master)](https://coveralls.io/github/fbbdev/node-fastcgi?branch=master)
6-
[![Dependency Status](https://gemnasium.com/fbbdev/node-fastcgi.svg)](https://gemnasium.com/fbbdev/node-fastcgi)
7-
[![devDependency Status](https://david-dm.org/fbbdev/node-fastcgi/dev-status.svg)](https://david-dm.org/fbbdev/node-fastcgi#info=devDependencies)
5+
[![Published version](https://img.shields.io/npm/v/node-fastcgi)](https://www.npmjs.com/package/node-fastcgi)
86
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
97

10-
[![NPM](https://nodei.co/npm/node-fastcgi.png?downloads=true)](https://nodei.co/npm/node-fastcgi/)
11-
128
This module is a drop-in replacement for node's standard http module (server only). Code written for a http server should work without changes with FastCGI. It can be used to build FastCGI applications or to convert existing node applications to FastCGI.
139

1410
The implementation is fully compliant with the [FastCGI 1.0 Specification](https://fast-cgi.github.io/spec).
1511

16-
17-
Example
18-
-------
12+
## Example
1913

2014
```javascript
2115
var fcgi = require('node-fastcgi');
@@ -39,9 +33,7 @@ fcgi.createServer(function(req, res) {
3933
}).listen();
4034
```
4135

42-
43-
Server constructor
44-
------------------
36+
## Server constructor
4537

4638
The `createServer` function takes four **optional** parameters:
4739

@@ -69,9 +61,7 @@ The `createServer` function takes four **optional** parameters:
6961

7062
`valueMap` maps FastCGI value names to keys in the `config` object. For more information read [the next section](#fastcgi-values)
7163

72-
73-
FastCGI values
74-
--------------
64+
## FastCGI values
7565

7666
FastCGI clients can query configuration values from applications with FCGI_GET_VALUES records. Those records contain a sequence of key-value pairs with empty values; the application must fetch the corresponding values for each key and send the data back to the client.
7767

@@ -88,11 +78,9 @@ fcgi.createServer(function (req, res) { /* ... */ }, {
8878
});
8979
```
9080

91-
**WARNING: This `valueMap` thing is complete nonsense and is definitely going to change in the next release.**
92-
81+
**WARNING: The `valueMap` API is a bad design choice and is going to change in the future.**
9382

94-
Listening for connections
95-
-------------------------
83+
## Listening for connections
9684

9785
When a FastCGI service is started, the stdin descriptor (fd 0) [is replaced by a bound socket](https://fast-cgi.github.io/spec#accepting-transport-connections). The service application can then start listening on that socket and accept connections.
9886

@@ -110,9 +98,7 @@ if (fcgi.isService()) {
11098
}
11199
```
112100

113-
114-
Request URL components
115-
----------------------
101+
## Request URL components
116102

117103
The `url` property of the request object is taken from the `REQUEST_URI` CGI variable, which is non-standard. If `REQUEST_URI` is missing, the url is built by joining three CGI variables:
118104

@@ -124,9 +110,7 @@ For more information read [section 4.1](https://tools.ietf.org/html/rfc3875#sect
124110

125111
Raw CGI variables can be accessed through the `params` property of the socket object. More information [here](#the-socket-object).
126112

127-
128-
Authorizer and filter requests
129-
------------------------------
113+
## Authorizer and filter requests
130114

131115
Authorizer requests may have no url. Response objects for the authorizer role come with the `Content-Type` header already set to `text/plain` and expose three additional methods:
132116

@@ -136,9 +120,7 @@ Authorizer requests may have no url. Response objects for the authorizer role co
136120

137121
Filter requests have an additional data stream exposed by the `dataStream` property of [the socket object](#the-socket-object) (`req.socket.dataStream`).
138122

139-
140-
The socket object
141-
-----------------
123+
## The socket object
142124

143125
The socket object exposed in requests and responses implements the `stream.Duplex` interface. It exposes the FastCGI stdin stream (request body)
144126
and translates writes to stdout FastCGI records.
@@ -149,9 +131,7 @@ The socket object exposes three additional properties:
149131
- `dataStream` implements `stream.Readable`, exposes the FastCGI data stream for the filter role.
150132
- `errorStream` implements `stream.Writable`, translates writes to stderr FastCGI Records.
151133

152-
153-
http module compatibility
154-
-------------------------
134+
## http module compatibility
155135

156136
The API is almost compatible with the http module from node v0.12 all the way to v6.x (the current series). Only the server API is implemented.
157137

@@ -164,9 +144,7 @@ Differences:
164144
- `req.trailers` will always be empty: CGI scripts never receive trailers
165145
- `res.writeContinue()` works as expected but should not be used. See first item
166146

167-
168-
License
169-
=======
147+
# License
170148

171149
The MIT License (MIT)
172150

0 commit comments

Comments
 (0)