Skip to content
Snippets Groups Projects
Commit 4fbaeea7 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

test api express

parent 42a321be
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,9 @@ const config = require('./config'); ...@@ -3,6 +3,9 @@ const config = require('./config');
// Driver SQL // Driver SQL
const Sequelize = require('sequelize'); const Sequelize = require('sequelize');
const { Op } = require("sequelize"); const { Op } = require("sequelize");
// API externe
const express = require('express')
const app = express()
// Couleurs de la console // Couleurs de la console
var colors = require('colors'); var colors = require('colors');
...@@ -235,6 +238,26 @@ recursiveAsyncReadLine(); //we have to actually start our recursion somehow ...@@ -235,6 +238,26 @@ recursiveAsyncReadLine(); //we have to actually start our recursion somehow
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// API
////////////////////////////////////////////////////////////////
app.get('/ping', (req,res) => {
res.send("Pong!")
})
app.get('/channels/:id', (req,res) => {
const id = req.params.id;
res.send(client.channels.cache.get(id));
})
app.listen(27001, () => {
console.log('['+'INFO'.yellow+'] Écoute sur '.brightWhite+'node.sl-projects.com:27001'.yellow);
});
////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// BOT DISCORD // BOT DISCORD
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment