v2
Kit Kasune 2 years ago
parent c5eba642d0
commit 8e8df4dadc
  1. 12
      src/api/index.js
  2. 2
      src/handle/runtime/events/ready.js

@ -1,7 +1,13 @@
const express = require('express');
module.exports = (client) => {
const api = express();
client.api = {wubzy: {}, natsuki: {}};
client.api.wubzy.app = api;
api.get('/', (req, res) => res.send("You've reached the wubzy.xyz API. If you're looking for Natsuki's endpoints, please append /natsuki to your query."));
api.get('/natsuki', (req, res) => res.send("You've reached Natsuki's API. Receiving this 200 reply indicates that Natsuki is online."));
client.api.wubzy.app.get('/', (req, res) => res.send("You've reached the wubzy.xyz API. If you're looking for Natsuki's endpoints, please append /natsuki to your query."));
client.api.wubzy.app.get('/natsuki', (req, res) => res.send("You've reached Natsuki's status endpoint. Receiving this 200 reply indicates that Natsuki is online. If you're looking for the Natsuki API, it has been moved to natsuki.app"));
client.api.wubzy.app.get('/natsuki/:any?', (req, res) => res.status(301).send("Natsuki's API permanently resides at natsuki.app"));
const server = api.listen(4072, () => console.log(`Ready at ${server.address().address}:${server.address().port}`));
client.api.wubzy.server = client.api.wubzy.app.listen(4072, () => console.log(`Ready at ${client.api.wubzy.server.address().address}:${client.api.wubzy.server.address().port}`));
};

@ -3,4 +3,6 @@ module.exports = async client => {
require('../../startup/run/hello')(client); // startup info
require('../../startup/run/setstatus')(client);
require('../../../api/index')(client);
};
Loading…
Cancel
Save