Skip to content

Commit

Permalink
v1.1.0 (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
not-amplify authored Nov 25, 2024
2 parents 5d66501 + 11c06cc commit ea26bbe
Show file tree
Hide file tree
Showing 33 changed files with 871 additions and 44,262 deletions.
18 changes: 4 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { createBareServer } from '@tomphttp/bare-server-node';
import express from 'express';
import cors from 'cors';
import http from 'node:http';
Expand All @@ -8,16 +7,14 @@ import chalk from 'chalk';
import { uvPath } from '@titaniumnetwork-dev/ultraviolet';
import { epoxyPath } from '@mercuryworkshop/epoxy-transport';
import { libcurlPath } from '@mercuryworkshop/libcurl-transport';
import { bareModulePath } from '@mercuryworkshop/bare-as-module3';
import { baremuxPath } from '@mercuryworkshop/bare-mux/node';
import wisp from 'wisp-server-node';
import { server as wisp } from '@mercuryworkshop/wisp-js/server';
import routes from './src/routes.js';

const server = http.createServer();
const app = express();
const __dirname = process.cwd();
const bare = createBareServer('/bare/');
const PORT = 6060;
const PORT = process.env.PORT || 6060;

app.use(cors());
app.use(express.urlencoded({ extended: true }));
Expand All @@ -26,23 +23,16 @@ app.use(express.static(path.join(__dirname, 'public')));
app.use('/epoxy/', express.static(epoxyPath));
app.use('/@/', express.static(uvPath));
app.use('/libcurl/', express.static(libcurlPath));
app.use('/baremod/', express.static(bareModulePath));
app.use('/baremux/', express.static(baremuxPath));

app.use('/', routes);

server.on('request', (req, res) => {
if (bare.shouldRoute(req)) {
bare.routeRequest(req, res);
} else {
app(req, res);
}
app(req, res);
});

server.on('upgrade', (req, socket, head) => {
if (bare.shouldRoute(req)) {
bare.routeUpgrade(req, socket, head);
} else if (req.url.endsWith('/wisp/')) {
if (req.url.endsWith('/wisp/')) {
wisp.routeRequest(req, socket, head);
} else {
socket.end();
Expand Down
20 changes: 8 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "space",
"version": "1.0.0",
"version": "1.1.0",
"type": "module",
"main": "index.js",
"scripts": {
Expand All @@ -20,23 +20,19 @@
"license": "ISC",
"description": "",
"engines": {
"node": ">=20.0.0 <21.0.0",
"node": ">=20.0.0 <22.0.0",
"pnpm": ">=9.0.0"
},
"dependencies": {
"@mercuryworkshop/bare-as-module3": "^2.2.2",
"@mercuryworkshop/bare-mux": "^2.0.2",
"@mercuryworkshop/epoxy-transport": "^2.1.3",
"@mercuryworkshop/libcurl-transport": "^1.3.6",
"@mercuryworkshop/wisp-js": "^0.1.0",
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
"@tomphttp/bare-server-node": "2.0.2",
"@mercuryworkshop/bare-mux": "^2.1.7",
"@mercuryworkshop/epoxy-transport": "^2.1.26",
"@mercuryworkshop/libcurl-transport": "^1.3.14",
"@mercuryworkshop/wisp-js": "^0.3.3",
"@titaniumnetwork-dev/ultraviolet": "^3.2.10",
"chalk": "^5.2.0",
"cors": "^2.8.5",
"express": "^4.19.2",
"lucide-static": "^0.424.0",
"meteorproxy": "^1.0.6-patch.1",
"wisp-server-node": "^1.1.3"
"lucide-static": "^0.424.0"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ea26bbe

Please sign in to comment.