mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
37 lines
804 B
JavaScript
37 lines
804 B
JavaScript
var auth = require('../core/jwt_auth.js').auth;
|
|
|
|
var RegisterEQW = function(app, api) {
|
|
app.post('/api/eqw/islocked', auth, function (req, res) {
|
|
api.Call('EQW::IsLocked', [])
|
|
.then(function(value) {
|
|
res.send({ response: value });
|
|
})
|
|
.catch(function(reason) {
|
|
res.sendStatus(500);
|
|
});
|
|
});
|
|
|
|
app.post('/api/eqw/lock', auth, function (req, res) {
|
|
api.Call('EQW::Lock', [])
|
|
.then(function(value) {
|
|
res.send({ response: value });
|
|
})
|
|
.catch(function(reason) {
|
|
res.sendStatus(500);
|
|
});
|
|
});
|
|
|
|
app.post('/api/eqw/unlock', auth, function (req, res) {
|
|
api.Call('EQW::Unlock', [])
|
|
.then(function(value) {
|
|
res.send({ response: value });
|
|
})
|
|
.catch(function(reason) {
|
|
res.sendStatus(500);
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
'Register': RegisterEQW
|
|
} |