Skip to content

Commit

Permalink
Formatted with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
xbubbo committed Jan 10, 2024
1 parent a932bd8 commit 1610b58
Show file tree
Hide file tree
Showing 58 changed files with 3,768 additions and 3,572 deletions.
26 changes: 13 additions & 13 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: gointerstellar
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: https://cash.app/$akabubbo
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: gointerstellar
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: https://cash.app/$akabubbo
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug Report
about: Create a report to help us improve
title: "[Bug] "
title: '[Bug] '
labels: Bug Report
assignees: xbubbo

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,10 +24,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Device Information (please complete the following information):**
- Device: [Ex. Chromebook, iPad, etc.]
- OS [Ex. ChromeOS, Windows, iOS
- Browser [Ex. Chrome, Safari]

- Device: [Ex. Chromebook, iPad, etc.]
- OS [Ex. ChromeOS, Windows, iOS
- Browser [Ex. Chrome, Safari]

**Additional context**
Add any other context about the problem here.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "[Feature]"
title: '[Feature]'
labels: Feature Request
assignees: xbubbo

---

**Is your feature request related to a problem? Please describe.**
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/game-request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Game Request
about: Suggest a game you would like to be added to the site.
title: "[Game]"
title: '[Game]'
labels: Game Request
assignees: xbubbo

---

**What is the name of the game?**
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
node_modules
package-lock.json
package.json
/static/m/
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"bracketSameLine": true,
"printWidth": 120
}
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
</div>
One of the most popular web proxies, used by over 5.7 million people in 2023.

### Consider joining our[ Discord Community](https://discord.gg/interstellar)
### Consider joining our[ Discord Community](https://discord.gg/interstellar)

> If you find this project useful, consider giving it a star in the original repository.
<h2 align="center">Features</h2>
Expand All @@ -21,6 +22,7 @@ One of the most popular web proxies, used by over 5.7 million people in 2023.
<h2 align="center">Deployment</h2>

### Easy Deployment

**Note:** You **cannot** deploy to static web hosts, including Netlify, Cloudflare Pages, and GitHub Pages.

<a target="_blank" href="https://heroku.com/deploy/?template=https://github.com/interstellarnetwork/interstellar"><img alt="Deploy to Heroku" src="https://binbashbanana.github.io/deploy-buttons/buttons/remade/heroku.svg"></a>
Expand All @@ -29,12 +31,15 @@ One of the most popular web proxies, used by over 5.7 million people in 2023.
<a target="_blank" href="https://app.cyclic.sh/api/app/deploy/interstellarnetwork/Interstellar"><img alt="Deploy to Cyclic" src="https://binbashbanana.github.io/deploy-buttons/buttons/remade/cyclic.svg"></a>

## Deployment Alternatives:

For more deployment options join our [Discord Server](https://discord.gg/interstellar) for tons of different ways to deploy Interstellar.

#### What happened to Replit Deployment?
As of January 1st 2024, Replit is [no longer free](https://blog.replit.com/hosting-changes). Try GitHub Codespaces instead.
#### What happened to Replit Deployment?

As of January 1st 2024, Replit is [no longer free](https://blog.replit.com/hosting-changes). Try GitHub Codespaces instead.

### GitHub Codespaces:

1. Create a GitHub account if you haven't already.
2. Click "Code" (green button) and then "Create Codespace on main."
3. In the terminal at the bottom, paste `npm i && npm run start`.
Expand All @@ -43,12 +48,15 @@ As of January 1st 2024, Replit is [no longer free](https://blog.replit.com/hosti
6. For subsequent uses in the same codespace, just run `npm run start`

## Need Help with Deployment?

If you're having trouble, reach out to us on [Discord](https://discord.gg/interstellar) for personalized support.

### Report Issues:

If you encounter problems, open an issue on GitHub, and we'll address it promptly.

# Credits

A huge thank you to all of the people who have contributed to Interstellar.

[![Contributors](https://contrib.rocks/image?repo=InterstellarNetwork/Interstellar)](https://github.com/InterstellarNetwork/Interstellar/graphs/contributors)
16 changes: 8 additions & 8 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "edu",
"description": "?",
"repository": "https://github.com/interstellarnetwork/interstellar",
"logo": "https://avatars.githubusercontent.com/u/103917385",
"keywords": ["school", "math"],
"image": "heroku/nodejs"
}
{
"name": "edu",
"description": "?",
"repository": "https://github.com/interstellarnetwork/interstellar",
"logo": "https://avatars.githubusercontent.com/u/103917385",
"keywords": ["school", "math"],
"image": "heroku/nodejs"
}
146 changes: 73 additions & 73 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
import express from 'express';
import http from 'node:http';
import { createBareServer } from "@tomphttp/bare-server-node";
import path from 'node:path';
import cors from 'cors';

const __dirname = process.cwd();
const server = http.createServer();
const app = express(server);
const bareServer = createBareServer('/v/');
const PORT = 8080;

app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(cors());
app.use(express.static(path.join(__dirname, 'static')));

const routes = [
{ path: '/', file: 'index.html' },
{ path: '/~', file: 'apps.html' },
{ path: '/-', file: 'games.html' },
{ path: '/!', file: 'settings.html' },
{ path: '/0', file: 'tabs.html' },
{ path: '/&', file: 'go.html' },
{ path: '/w', file: 'edu.html' },
];

app.get('/y/*', cors({ origin: false }), async (req, res, next) => {
try {
const reqTarget = `https://raw.githubusercontent.com/ypxa/y/main/${req.params[0]}`;
const asset = await fetch(reqTarget);
if (asset.ok) {
const data = await asset.arrayBuffer();
res.end(Buffer.from(data));
} else {
next();
}
} catch (error) {
console.error('Error fetching:', error);
next(error);
}
});

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

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

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

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

server.listen({
port: PORT,
});
import express from 'express'
import http from 'node:http'
import { createBareServer } from '@tomphttp/bare-server-node'
import path from 'node:path'
import cors from 'cors'

const __dirname = process.cwd()
const server = http.createServer()
const app = express(server)
const bareServer = createBareServer('/v/')
const PORT = 8080

app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(cors())
app.use(express.static(path.join(__dirname, 'static')))

const routes = [
{ path: '/', file: 'index.html' },
{ path: '/~', file: 'apps.html' },
{ path: '/-', file: 'games.html' },
{ path: '/!', file: 'settings.html' },
{ path: '/0', file: 'tabs.html' },
{ path: '/&', file: 'go.html' },
{ path: '/w', file: 'edu.html' },
]

app.get('/y/*', cors({ origin: false }), async (req, res, next) => {
try {
const reqTarget = `https://raw.githubusercontent.com/ypxa/y/main/${req.params[0]}`
const asset = await fetch(reqTarget)

if (asset.ok) {
const data = await asset.arrayBuffer()
res.end(Buffer.from(data))
} else {
next()
}
} catch (error) {
console.error('Error fetching:', error)
next(error)
}
})

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

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

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

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

server.listen({
port: PORT,
})
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"node": ">=16.0.0"
},
"scripts": {
"start": "node index.js"
"start": "node index.js",
"format": "prettier --write ."
},
"author": "",
"license": "GPL-3.0-or-later",
Expand All @@ -18,8 +19,6 @@
"express": "^4.18.2"
},
"devDependencies": {
"eslint": "^8.36.0",
"prettier": "^3.0.3"
"prettier": "3.1.1"
}
}

10 changes: 5 additions & 5 deletions render.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
- type: web
name: edu
env: docker
plan: free
services:
- type: web
name: edu
env: docker
plan: free
3 changes: 2 additions & 1 deletion static/apps.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<a class="navbar-link" href="/./~"><span class="material-symbols-outlined weird-icon">apps</span>Apps</a>
<a class="navbar-link" href="/./0"><i class="fa-solid fa-table navbar-icon"></i>Tabs</a>
<a class="navbar-link" href="/./!"><i class="fa-solid fa-gear navbar-icon settings-icon"></i>Settings</a>
</div></div></div></div>
</div>
</div>
<!-- Nav Bar End-->
<div class="input-container">
<input type="text" id="searchbarbottom" onkeyup="search_bar()" placeholder="Search">
Expand Down
Loading

0 comments on commit 1610b58

Please sign in to comment.