Skip to content

Commit

Permalink
🚀 | v5.0.1 (Updated Ultraviolet)
Browse files Browse the repository at this point in the history
  • Loading branch information
xbubbo committed Oct 13, 2023
1 parent 1759afb commit 2af0fe9
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 41,277 deletions.
48 changes: 21 additions & 27 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import express from "express";
import http from "node:http";
import createBareServer from "@tomphttp/bare-server-node";
import path from "node:path";
import * as dotenv from "dotenv";
import express from 'express';
import http from 'node:http';
import { createBareServer } from '@tomphttp/bare-server-node';
import path from 'node:path';
import * as dotenv from 'dotenv';
dotenv.config();

const __dirname = process.cwd();
const server = http.createServer();
const app = express(server);
const bareServer = createBareServer("/outerspace/");
const PORT = process.env.PORT
const bareServer = createBareServer('/outerspace/');
const PORT = process.env.PORT;

app.use(express.json());
app.use(
Expand All @@ -18,51 +18,45 @@ app.use(
})
);

app.use(express.static(path.join(__dirname, "static")));
app.use(express.static(path.join(__dirname, 'static')));

const routes = [
{ path: "/", file: "index.html" },
{ path: "/news", file: "apps.html" },
{ path: "/algebra", file: "games.html" },
{ path: "/settings", file: "settings.html" },
{ path: "/tabs", file: "tabs.html" },
{ path: "/tabinner", file: "tabinner.html" },
{ path: "/go", file: "go.html" },
{ path: "/loading", file: "loading.html" },
{ path: "/404", file: "404.html" },
{ path: '/', file: 'index.html' },
{ path: '/news', file: 'apps.html' },
{ path: '/algebra', file: 'games.html' },
{ path: '/settings', file: 'settings.html' },
{ path: '/tabs', file: 'tabs.html' },
{ path: '/tabinner', file: 'tabinner.html' },
{ path: '/go', file: 'go.html' },
{ path: '/loading', file: 'loading.html' },
];

routes.forEach((route) => {
app.get(route.path, (req, res) => {
res.sendFile(path.join(__dirname, "static", route.file));
res.sendFile(path.join(__dirname, 'static', route.file));
});
});

app.get("/*", (req, res) => {
res.redirect("/404");
});

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

server.on("upgrade", (req, socket, head) => {
server.on('upgrade', (req, socket, head) => {
if (bareServer.shouldRoute(req)) {
bareServer.routeUpgrade(req, socket, head);
} else {
socket.end();
}
});

server.on("listening", () => {
server.on('listening', () => {
console.log(`Running at http://localhost:${process.env.PORT}`);
});

server.listen({
port: PORT,
});

});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"@titaniumnetwork-dev/ultraviolet": "^1.0.10",
"@tomphttp/bare-server-node": "^1.2.6",
"@titaniumnetwork-dev/ultraviolet": "^2.0.0",
"@tomphttp/bare-server-node": "^2.0.1",
"express": "^4.18.2"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions static/about-us/uv.bundle.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/about-us/uv.client.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions static/about-us/uv.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*global Ultraviolet*/
self.__uv$config = {
prefix: '/astronomy/',
bare: '/outerspace/',
encodeUrl: Ultraviolet.codec.xor.encode,
decodeUrl: Ultraviolet.codec.xor.decode,
handler: '/about-us/uv.handler.js',
client: '/about-us/uv.client.js',
bundle: '/about-us/uv.bundle.js',
config: '/about-us/uv.config.js',
sw: '/about-us/uv.sw.js',
};
2 changes: 2 additions & 0 deletions static/about-us/uv.handler.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/about-us/uv.sw.js

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

4 changes: 2 additions & 2 deletions static/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<link rel="shortcut icon" id="dynamic-favicon" href="favicon.png">
<title id="dynamic-title">Classes</title>
<script src="scripts/index.js"></script>
<script src="./h/mathematics.js"></script>
<script src="./h/geography.js"></script>
<script src="./about-us/uv.bundle.js"></script>
<script src="./about-us/uv.config.js"></script>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down
4 changes: 2 additions & 2 deletions static/games.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<link rel="shortcut icon" id="dynamic-favicon" href="favicon.png">
<title id="dynamic-title">Classes</title>
<script src="scripts/index.js"></script>
<script src="./h/mathematics.js"></script>
<script src="./h/geography.js"></script>
<script src="./about-us/uv.bundle.js"></script>
<script src="./about-us/uv.config.js"></script>
<!-- Meta Tags -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down
Loading

7 comments on commit 2af0fe9

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar-v5 ❌ Failed View Logs 2023-10-13T22:53:02.897Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
instell ✅ Deployed View Logs 2023-10-13T22:53:18.429Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
we-love-art ✅ Deployed View Logs 2023-10-13T22:53:24.762Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
your-mom ✅ Deployed View Logs 2023-10-13T22:53:49.248Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-13T22:54:02.559Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-13T22:54:33.661Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on 2af0fe9 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2023-10-13T22:54:35.205Z

Please sign in to comment.