Skip to content

Commit

Permalink
Add Discord server link to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ZandercraftGames committed Sep 28, 2023
1 parent a75b14e commit 8b060d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Binary file modified README.md
Binary file not shown.
25 changes: 18 additions & 7 deletions routes/api.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
const express = require('express')

Check failure on line 1 in routes/api.js

View workflow job for this annotation

GitHub Actions / Qodana for JS

Standard code style

Standard code style: Install the 'eslint' package
const pckg = require('../package.json')
const branchName = require('current-git-branch')()
const branchName = require('current-git-branch')() || "release"
const database = require('../database')
const router = express.Router()

router.get('/', (req, res) => {
res.json({
return res.json({
api: pckg.prettyName,
version: pckg.version,
stream: branchName
stream: branchName,
meta: {
description: "TechnicFlux implementation of Technic's Solder API for retrieval of modpack and mod info.",
license: `https://github.com/Zandercraft/TechnicFlux/blob/${branchName}/LICENSE.txt`,
repo: "https://github.com/Zandercraft/TechnicFlux",
documentation: "https://github.com/Zandercraft/TechnicFlux/wiki",
attribution: {
name: "Zandercraft",
github: "https://github.com/Zandercraft",
website: "https://zandercraft.ca",
}
}
})
})

Expand Down Expand Up @@ -134,28 +145,28 @@ router.get('/verify/:key?', (req, res) => {
if (api_key !== undefined) {
if (api_key === process.env?.API_KEY)
// Key validated
res.json({
return res.json({
valid: 'Key validated.',
name: 'API KEY',
created_at: 'A long time ago'
})
else {
// Invalid key provided
res.json({
return res.json({
error: 'Invalid key provided.'
})
}
} else {
// No key provided
res.json({
return res.json({
error: 'No API key provided.'
})
}
})

/* Invalid API Routes */
router.all('*', (req, res) => {
res.status(405).json({
return res.status(405).json({
code: res.statusCode,
message: 'Invalid route.'
})
Expand Down

0 comments on commit 8b060d7

Please sign in to comment.