diff --git a/server.js b/server.js
index aaf597e..dbc4021 100644
--- a/server.js
+++ b/server.js
@@ -79,28 +79,30 @@ module.exports = (client) => {
});
});
app.get('/update', async (req, res) => {
- if (req.headers.authorization !== 'Update') {
+ console.log(req.headers['user-agent']);
+ if (req.headers.authorization === 'Update') {
+ await exec('git pull')
+ .then((r) => {
+ console.log('Pulled latest changes');
+ res.status(200).jsonp({
+ success: true,
+ message: 'Successfully pulled latest changes'
+ });
+ //trying.edit('```fix\n' + r.stdout + '```');
+ })
+ .catch((error) => {
+ res.status(400).jsonp({
+ success: false,
+ message: error.message
+ });
+ console.error(error);
+ });
+ } else {
res.status(400).jsonp({
success: false,
message: 'You are not authorized to access this Endpoint'
});
}
- await exec('git pull')
- .then((r) => {
- console.log('Pulled latest changes');
- res.status(200).jsonp({
- success: true,
- message: 'Successfully pulled latest changes'
- });
- trying.edit('```fix\n' + r.stdout + '```');
- })
- .catch((error) => {
- res.status(400).jsonp({
- success: false,
- message: error.message
- });
- console.error(error);
- });
});
app.listen(port /* , hostname */, () => {
diff --git a/views/index.hbs b/views/index.hbs
index 45cc5cb..7deb0ba 100644
--- a/views/index.hbs
+++ b/views/index.hbs
@@ -9,7 +9,7 @@