Compare commits
No commits in common. "af2ad72c0071d1206d9d9ab9e8e6782dc8d59d76" and "3856c39e04b3a88e6926947caaa4abba618c99b3" have entirely different histories.
af2ad72c00
...
3856c39e04
2466
package-lock.json
generated
2466
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
22
package.json
22
package.json
@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "base-api-ts",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsc --project ./",
|
||||
"start:dev": "nodemon src/server.ts",
|
||||
"start:prod": "node dist/server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.17.1",
|
||||
"ts-node-dev": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.11",
|
||||
"@types/node": "^14.14.22",
|
||||
"nodemon": "^2.0.7",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.1.3"
|
||||
}
|
||||
}
|
26
src/app.ts
26
src/app.ts
@ -1,26 +0,0 @@
|
||||
import express from "express";
|
||||
|
||||
import routes from "./routes/routes";
|
||||
import minecraft_routes from "./routes/minecraft/minecraft_routes";
|
||||
|
||||
class App {
|
||||
public server;
|
||||
|
||||
constructor() {
|
||||
this.server = express();
|
||||
|
||||
this.middlewares();
|
||||
this.routes();
|
||||
}
|
||||
|
||||
middlewares() {
|
||||
this.server.use(express.json());
|
||||
}
|
||||
|
||||
routes() {
|
||||
this.server.use(routes);
|
||||
this.server.use('/minecraft', minecraft_routes)
|
||||
}
|
||||
}
|
||||
|
||||
export default new App().server;
|
@ -1,55 +0,0 @@
|
||||
import internal from "stream"
|
||||
import { Url } from "url"
|
||||
|
||||
interface HeliosDistribution{
|
||||
version:string
|
||||
//servers:Minecraft_1_12_2_server
|
||||
}
|
||||
|
||||
interface MinecraftServer{
|
||||
id:string
|
||||
name:string
|
||||
description:string
|
||||
icon:string
|
||||
version:string
|
||||
address:string
|
||||
minecraftVersion:string
|
||||
mainServer:boolean
|
||||
autoconnect:boolean
|
||||
share_required_mods:ForgeMod[]
|
||||
client_required_mods:ForgeMod[]
|
||||
client_optional_mods:ForgeMod[]
|
||||
}
|
||||
|
||||
interface ForgeMod{
|
||||
id:ForgeModId
|
||||
name:string
|
||||
type:string
|
||||
artifact:ForgeModArtifact
|
||||
sub_modules:ForgeMod[]
|
||||
}
|
||||
|
||||
interface ForgeModId{
|
||||
class:string
|
||||
label:string
|
||||
version:string
|
||||
}
|
||||
|
||||
interface ForgeModArtifact{
|
||||
size:number
|
||||
MD5:string
|
||||
url:Url
|
||||
}
|
||||
|
||||
export default class Minecraft{
|
||||
constructor(){
|
||||
this.generateDistribution = this.generateDistribution.bind(this)
|
||||
}
|
||||
|
||||
public generateDistribution() {
|
||||
var distribution: HeliosDistribution = {
|
||||
version: "12.254"
|
||||
}
|
||||
return distribution
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import { Router } from "express";
|
||||
import Minecraft from "../../../minecraft/1.12.2/heliosDistribution"
|
||||
|
||||
const minecraft = new Minecraft //Is this right?
|
||||
const routes = Router();
|
||||
|
||||
routes.get("/", (req, res) => {
|
||||
return res.json({ message: "yes" });
|
||||
});
|
||||
|
||||
routes.get("/distribution", (req, res) =>{
|
||||
res.send(minecraft.generateDistribution())
|
||||
});
|
||||
|
||||
export default routes;
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
import { Router } from "express";
|
||||
import minecraft_1_12_2_routes from './1_12_2/routes'
|
||||
|
||||
const routes = Router();
|
||||
|
||||
routes.get("/", (req, res) => {
|
||||
return res.json({ message: "Hello World" });
|
||||
});
|
||||
routes.use
|
||||
routes.use('/1.12.2', minecraft_1_12_2_routes)
|
||||
export default routes;
|
@ -1,9 +0,0 @@
|
||||
import { Router } from "express";
|
||||
|
||||
const routes = Router();
|
||||
|
||||
routes.get("/", (req, res) => {
|
||||
return res.json({ message: "Hello World" });
|
||||
});
|
||||
|
||||
export default routes;
|
@ -1,3 +0,0 @@
|
||||
import app from "./app";
|
||||
|
||||
app.listen(3000);
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["node_modules/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
Loading…
Reference in New Issue
Block a user