Skip to content

Commit

Permalink
open sourced
Browse files Browse the repository at this point in the history
This the beginning of the open sourcing of terbium
  • Loading branch information
NovaAppsInc committed Aug 24, 2022
0 parents commit 6fa7108
Show file tree
Hide file tree
Showing 113 changed files with 55,145 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(async() => {
await import('./index.mjs');
})();
21 changes: 21 additions & 0 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Server from 'bare-server-node';
import http from 'http';
import nodeStatic from 'node-static';


const bare = new Server('/bare/', '');
const serve = new nodeStatic.Server('static/');

const server = http.createServer();

server.on('request', (request, response) => {
if (bare.route_request(request, response)) return true;
serve.serve(request, response);
});

server.on('upgrade', (req, socket, head) => {
if(bare.route_upgrade(req, socket, head))return;
socket.end();
});

server.listen(process.env.PORT || 6969);
Loading

0 comments on commit 6fa7108

Please sign in to comment.