mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-09-30 06:12:26 -05:00
Added conntest endpoint
This commit is contained in:
@@ -11,6 +11,7 @@ const config = require('./config.json');
|
||||
const { http: { port } } = config;
|
||||
const app = express();
|
||||
|
||||
const conntest = require('./services/conntest');
|
||||
const account = require('./services/account');
|
||||
const nasc = require('./services/nasc');
|
||||
const datastore = require('./services/datastore');
|
||||
@@ -30,6 +31,7 @@ app.use(express.urlencoded({
|
||||
app.use(xmlparser);
|
||||
|
||||
// import the servers into one
|
||||
app.use(conntest);
|
||||
app.use(account);
|
||||
app.use(nasc);
|
||||
app.use(datastore);
|
||||
|
||||
36
src/services/conntest/index.js
Normal file
36
src/services/conntest/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
// handles conntest endpoints
|
||||
|
||||
const express = require('express');
|
||||
const subdomain = require('express-subdomain');
|
||||
const logger = require('../../../logger');
|
||||
|
||||
// Router to handle the subdomain restriction
|
||||
const conntest = express.Router();
|
||||
|
||||
// Setup route
|
||||
logger.info('[conntest] Applying imported routes');
|
||||
conntest.get('/', async (request, response) => {
|
||||
response.set('Content-Type', 'text/html');
|
||||
response.set('X-Organization', 'Nintendo');
|
||||
|
||||
response.send(`
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>HTML Page</title>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF">
|
||||
This is test.html page
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
});
|
||||
|
||||
// Main router for endpoints
|
||||
const router = express.Router();
|
||||
|
||||
// Create subdomains
|
||||
logger.info('[conntest] Creating \'conntest\' subdomain');
|
||||
router.use(subdomain('conntest', conntest));
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user