Extend from WebHandlerModule

This commit is contained in:
Bryan Ashby 2022-12-31 15:48:51 -07:00
parent 0e32e3856e
commit a00a93859e
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
3 changed files with 18 additions and 4 deletions

View File

@ -58,7 +58,10 @@ exports.getModule = class ProfileServerModule extends ServerModule {
this._getUser(resource, resp, (err, user, accountName) => { this._getUser(resource, resp, (err, user, accountName) => {
if (err) { if (err) {
// |resp| already written to // |resp| already written to
return Log.warn({ error: err.message }, `Profile request failed: ${req.url}`); return Log.warn(
{ error: err.message },
`Profile request failed: ${req.url}`
);
} }
// TODO: More user information here // TODO: More user information here
@ -77,7 +80,6 @@ exports.getModule = class ProfileServerModule extends ServerModule {
} }
_getUser(resource, resp, cb) { _getUser(resource, resp, cb) {
const notFound = () => { const notFound = () => {
this.webServer.instance.respondWithError( this.webServer.instance.respondWithError(
resp, resp,

View File

@ -1,4 +1,4 @@
const { ServerModule } = require('../../../server_module'); const WebHandlerModule = require('../../../web_handler_module');
const Config = require('../../../config').get; const Config = require('../../../config').get;
const { Errors } = require('../../../enig_error'); const { Errors } = require('../../../enig_error');
@ -16,7 +16,7 @@ exports.moduleInfo = {
packageName: 'codes.l33t.enigma.web.handler.finger', packageName: 'codes.l33t.enigma.web.handler.finger',
}; };
exports.getModule = class WebFingerServerModule extends ServerModule { exports.getModule = class WebFingerServerModule extends WebHandlerModule {
constructor() { constructor() {
super(); super();
} }

View File

@ -0,0 +1,12 @@
const { PluginModule } = require('./plugin_module');
module.exports = class WebHandlerModule extends PluginModule {
constructor(options) {
super(options);
}
init(cb) {
// to be implemented!
return cb(null);
}
};