api route
This commit is contained in:
parent
fafbda09bb
commit
30a1644d10
2 changed files with 31 additions and 3 deletions
17
Dashboard/routes/api.js
Normal file
17
Dashboard/routes/api.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
var express = require('express');
|
||||||
|
var api = express.Router();
|
||||||
|
|
||||||
|
|
||||||
|
api.get('/', (req, res) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
console.log(ints['sfw'][1])
|
||||||
|
|
||||||
|
res.status(200).jsonp({
|
||||||
|
success: true
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = api;
|
|
@ -1,5 +1,12 @@
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const { hostname, port, authorization, source, invite, type } = require('../config');
|
const {
|
||||||
|
hostname,
|
||||||
|
port,
|
||||||
|
authorization,
|
||||||
|
source,
|
||||||
|
invite,
|
||||||
|
type
|
||||||
|
} = require('../config');
|
||||||
const db = require('quick.db');
|
const db = require('quick.db');
|
||||||
const Backend = new db.table('backend');
|
const Backend = new db.table('backend');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
@ -26,7 +33,9 @@ app.set('view options', {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({
|
||||||
|
extended: true
|
||||||
|
}));
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
@ -42,6 +51,8 @@ app.use(
|
||||||
].join(' ');
|
].join(' ');
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
app.use('/api', require(''))
|
||||||
let support = 'https://discord.gg/' + Backend.get('Info.invite');
|
let support = 'https://discord.gg/' + Backend.get('Info.invite');
|
||||||
module.exports = (client) => {
|
module.exports = (client) => {
|
||||||
app.get('/', async (req, res) => {
|
app.get('/', async (req, res) => {
|
||||||
|
|
Loading…
Reference in a new issue