forked from TerbiumOS/webOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This the beginning of the open sourcing of terbium
- Loading branch information
0 parents
commit 6fa7108
Showing
113 changed files
with
55,145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(async() => { | ||
await import('./index.mjs'); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Oops, something went wrong.