2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Doc fixes, minor examples cleanup (#2198)

* README.md COOKBOOK.md: minor fixes

 * simplify language

* ECOSYSTEM: create a few categories

* Examples: log port listening to

* upgrade bootstrap 3 -> 4 in examples

bootstrap 4 is slightly smaller then 3.2.0
so it should also help load examples faster

* categorize 0.19 items a little differently

surface user/consumer changes first
This commit is contained in:
Avindra Goolcharan
2019-09-07 08:05:26 -04:00
committed by Felipe Martins
parent a11cdf4683
commit 6a4a85c57f
12 changed files with 44 additions and 27 deletions
+7 -4
View File
@@ -1,5 +1,4 @@
var fs = require('fs');
var url = require('url');
var path = require('path');
var http = require('http');
var argv = require('minimist')(process.argv.slice(2));
@@ -10,7 +9,7 @@ function listDirs(root) {
var files = fs.readdirSync(root);
var dirs = [];
for (var i=0, l=files.length; i<l; i++) {
for (var i = 0, l = files.length; i < l; i++) {
var file = files[i];
if (file[0] !== '.') {
var stat = fs.statSync(path.join(root, file));
@@ -105,7 +104,7 @@ server = http.createServer(function (req, res) {
if (/\/$/.test(url)) {
url += 'index.html';
}
// Format request /get -> /get/index.html
var parts = url.split('/');
if (dirs.indexOf(parts[parts.length - 1]) > -1) {
@@ -134,4 +133,8 @@ server = http.createServer(function (req, res) {
}
});
server.listen(argv.p || 3000);
const PORT = argv.p || 3000;
server.listen(PORT);
console.log("Examples running on " + PORT);