Skip to content

Commit 9847773

Browse files
authored
docs(servers): order by github stars and npm downloads (chimurai#576)
1 parent b47e0a5 commit 9847773

File tree

1 file changed

+85
-75
lines changed

1 file changed

+85
-75
lines changed

recipes/servers.md

+85-75
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,24 @@ Missing a server? Feel free to extend this list of examples.
66

77
<!-- TOC depthfrom:2 insertanchor:false -->
88

9-
- [Browser-Sync](#browser-sync)
109
- [Express](#express)
1110
- [Connect](#connect)
11+
- [Browser-Sync](#browser-sync)
1212
- [fastify](#fastify)
13-
- [lite-server](#lite-server)
1413
- [Polka](#polka)
14+
- [lite-server](#lite-server)
1515
- [grunt-contrib-connect](#grunt-contrib-connect)
16-
- [grunt-browser-sync](#grunt-browser-sync)
1716
- [gulp-connect](#gulp-connect)
17+
- [grunt-browser-sync](#grunt-browser-sync)
1818
- [gulp-webserver](#gulp-webserver)
1919

2020
<!-- /TOC -->
2121

22-
## Browser-Sync
23-
24-
https://github.com/BrowserSync/browser-sync
25-
[![GitHub stars](https://img.shields.io/github/stars/BrowserSync/browser-sync.svg?style=social&label=Star)](https://github.com/BrowserSync/browser-sync)
26-
27-
```javascript
28-
const browserSync = require('browser-sync').create();
29-
const { createProxyMiddleware } = require('http-proxy-middleware');
30-
31-
const apiProxy = createProxyMiddleware('/api', {
32-
target: 'http://www.example.org',
33-
changeOrigin: true, // for vhosted sites
34-
});
35-
36-
browserSync.init({
37-
server: {
38-
baseDir: './',
39-
port: 3000,
40-
middleware: [apiProxy],
41-
},
42-
startPath: '/api',
43-
});
44-
```
45-
4622
## Express
4723

4824
https://github.com/expressjs/express
4925
[![GitHub stars](https://img.shields.io/github/stars/expressjs/express.svg?style=social&label=Star)](https://github.com/expressjs/express)
26+
![express downloads](https://img.shields.io/npm/dm/express)
5027

5128
```javascript
5229
const express = require('express');
@@ -67,6 +44,7 @@ app.listen(3000);
6744

6845
https://github.com/senchalabs/connect
6946
[![GitHub stars](https://img.shields.io/github/stars/senchalabs/connect.svg?style=social&label=Star)](https://github.com/senchalabs/connect)
47+
![connect downloads](https://img.shields.io/npm/dm/connect)
7048

7149
```javascript
7250
const http = require('http');
@@ -84,9 +62,35 @@ app.use(apiProxy);
8462
http.createServer(app).listen(3000);
8563
```
8664

65+
## Browser-Sync
66+
67+
https://github.com/BrowserSync/browser-sync
68+
[![GitHub stars](https://img.shields.io/github/stars/BrowserSync/browser-sync.svg?style=social&label=Star)](https://github.com/BrowserSync/browser-sync)
69+
![browser-sync downloads](https://img.shields.io/npm/dm/browser-sync)
70+
71+
```javascript
72+
const browserSync = require('browser-sync').create();
73+
const { createProxyMiddleware } = require('http-proxy-middleware');
74+
75+
const apiProxy = createProxyMiddleware('/api', {
76+
target: 'http://www.example.org',
77+
changeOrigin: true, // for vhosted sites
78+
});
79+
80+
browserSync.init({
81+
server: {
82+
baseDir: './',
83+
port: 3000,
84+
middleware: [apiProxy],
85+
},
86+
startPath: '/api',
87+
});
88+
```
89+
8790
## fastify
8891

8992
https://github.com/fastify/fastify [![GitHub stars](https://img.shields.io/github/stars/fastify/fastify.svg?style=social&label=Star)](https://github.com/fastify/fastify)
93+
![fastify downloads](https://img.shields.io/npm/dm/fastify)
9094

9195
```javascript
9296
const fastify = require('fastify')({ logger: true });
@@ -111,10 +115,33 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
111115
// curl http://localhost:3000/users
112116
```
113117

118+
## Polka
119+
120+
https://github.com/lukeed/polka
121+
[![GitHub stars](https://img.shields.io/github/stars/lukeed/polka.svg?style=social&label=Star)](https://github.com/lukeed/polka)
122+
![polka downloads](https://img.shields.io/npm/dm/polka)
123+
124+
```javascript
125+
const polka = require('polka');
126+
const { createProxyMiddleware } = require('http-proxy-middleware');
127+
128+
const app = polka();
129+
130+
app.use(
131+
createProxyMiddleware({
132+
target: 'http://www.example.org',
133+
changeOrigin: true,
134+
})
135+
);
136+
137+
app.listen(3000);
138+
```
139+
114140
## lite-server
115141

116142
https://github.com/johnpapa/lite-server
117143
[![GitHub stars](https://img.shields.io/github/stars/johnpapa/lite-server.svg?style=social&label=Star)](https://github.com/johnpapa/lite-server)
144+
![lite-server downloads](https://img.shields.io/npm/dm/lite-server)
118145

119146
File: `bs-config.js`
120147

@@ -138,31 +165,11 @@ module.exports = {
138165
};
139166
```
140167

141-
## Polka
142-
143-
https://github.com/lukeed/polka
144-
[![GitHub stars](https://img.shields.io/github/stars/lukeed/polka.svg?style=social&label=Star)](https://github.com/lukeed/polka)
145-
146-
```javascript
147-
const polka = require('polka');
148-
const { createProxyMiddleware } = require('http-proxy-middleware');
149-
150-
const app = polka();
151-
152-
app.use(
153-
createProxyMiddleware({
154-
target: 'http://www.example.org',
155-
changeOrigin: true,
156-
})
157-
);
158-
159-
app.listen(3000);
160-
```
161-
162168
## grunt-contrib-connect
163169

164170
https://github.com/gruntjs/grunt-contrib-connect
165171
[![GitHub stars](https://img.shields.io/github/stars/gruntjs/grunt-contrib-connect.svg?style=social&label=Star)](https://github.com/gruntjs/grunt-contrib-connect)
172+
![grunt-contrib-connect downloads](https://img.shields.io/npm/dm/grunt-contrib-connect)
166173

167174
As an `Array`:
168175

@@ -211,10 +218,39 @@ grunt.initConfig({
211218
});
212219
```
213220

221+
## gulp-connect
222+
223+
https://github.com/avevlad/gulp-connect
224+
[![GitHub stars](https://img.shields.io/github/stars/avevlad/gulp-connect.svg?style=social&label=Star)](https://github.com/avevlad/gulp-connect)
225+
![gulp-connect downloads](https://img.shields.io/npm/dm/gulp-connect)
226+
227+
```javascript
228+
const gulp = require('gulp');
229+
const connect = require('gulp-connect');
230+
const { createProxyMiddleware } = require('http-proxy-middleware');
231+
232+
gulp.task('connect', function () {
233+
connect.server({
234+
root: ['./app'],
235+
middleware: function (connect, opt) {
236+
const apiProxy = createProxyMiddleware('/api', {
237+
target: 'http://www.example.org',
238+
changeOrigin: true, // for vhosted sites
239+
});
240+
241+
return [apiProxy];
242+
},
243+
});
244+
});
245+
246+
gulp.task('default', ['connect']);
247+
```
248+
214249
## grunt-browser-sync
215250

216251
https://github.com/BrowserSync/grunt-browser-sync
217252
[![GitHub stars](https://img.shields.io/github/stars/BrowserSync/grunt-browser-sync.svg?style=social&label=Star)](https://github.com/BrowserSync/grunt-browser-sync)
253+
![grunt-browser-sync downloads](https://img.shields.io/npm/dm/grunt-browser-sync)
218254

219255
```javascript
220256
const { createProxyMiddleware } = require('http-proxy-middleware');
@@ -241,37 +277,11 @@ grunt.initConfig({
241277
});
242278
```
243279

244-
## gulp-connect
245-
246-
https://github.com/avevlad/gulp-connect
247-
[![GitHub stars](https://img.shields.io/github/stars/avevlad/gulp-connect.svg?style=social&label=Star)](https://github.com/avevlad/gulp-connect)
248-
249-
```javascript
250-
const gulp = require('gulp');
251-
const connect = require('gulp-connect');
252-
const { createProxyMiddleware } = require('http-proxy-middleware');
253-
254-
gulp.task('connect', function () {
255-
connect.server({
256-
root: ['./app'],
257-
middleware: function (connect, opt) {
258-
const apiProxy = createProxyMiddleware('/api', {
259-
target: 'http://www.example.org',
260-
changeOrigin: true, // for vhosted sites
261-
});
262-
263-
return [apiProxy];
264-
},
265-
});
266-
});
267-
268-
gulp.task('default', ['connect']);
269-
```
270-
271280
## gulp-webserver
272281

273282
https://github.com/schickling/gulp-webserver
274283
[![GitHub stars](https://img.shields.io/github/stars/schickling/gulp-webserver.svg?style=social&label=Star)](https://github.com/schickling/gulp-webserver)
284+
![gulp-webserver downloads](https://img.shields.io/npm/dm/gulp-webserver)
275285

276286
```javascript
277287
const gulp = require('gulp');

0 commit comments

Comments
 (0)