diff options
| author | 8cy <[email protected]> | 2020-04-30 16:28:22 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-30 16:28:22 -0700 |
| commit | 60e17ae0b6d7caa6ef1bd4dfdeaf26d055b06701 (patch) | |
| tree | 9c5abfd06eb584aea8816369a293c6e5c83595b9 | |
| parent | allow cors, v1.1.0 (diff) | |
| download | uppity-60e17ae0b6d7caa6ef1bd4dfdeaf26d055b06701.tar.xz uppity-60e17ae0b6d7caa6ef1bd4dfdeaf26d055b06701.zip | |
cors, v1.1.1
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | ws/ws.js | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/package.json b/package.json index 5932024..6cad5d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uppity", - "version": "1.1.0", + "version": "1.1.1", "description": "This bot's sole purpose is to check the uptime of uwufier.", "main": "./bot.js", "scripts": { @@ -9,7 +9,6 @@ class WebSocket { this.client = client; this.app = express(); - this.app.use(allowCrossDomain); this.app.engine('hbs', hbs({ extname: 'hbs', defaultLayout: 'layout', @@ -45,6 +44,12 @@ class WebSocket { // http://localhost:port?token=123456 registerRoots() { + this.app.all('*', function (req, res, next) { + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS'); + res.header('Access-Control-Allow-Headers', 'Content-Type'); + next(); + }); this.app.get('/', (req, res) => { var _token = req.query.token; if (this.checkToken(_token)) { |