Skip to content

Commit 6fa7108

Browse files
committed
open sourced
This the beginning of the open sourcing of terbium
0 parents  commit 6fa7108

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+55145
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(async() => {
2+
await import('./index.mjs');
3+
})();

index.mjs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Server from 'bare-server-node';
2+
import http from 'http';
3+
import nodeStatic from 'node-static';
4+
5+
6+
const bare = new Server('/bare/', '');
7+
const serve = new nodeStatic.Server('static/');
8+
9+
const server = http.createServer();
10+
11+
server.on('request', (request, response) => {
12+
if (bare.route_request(request, response)) return true;
13+
serve.serve(request, response);
14+
});
15+
16+
server.on('upgrade', (req, socket, head) => {
17+
if(bare.route_upgrade(req, socket, head))return;
18+
socket.end();
19+
});
20+
21+
server.listen(process.env.PORT || 6969);

0 commit comments

Comments
 (0)