Stage 2 : Finish Alpha, Begin Beta #2
|
@ -1,8 +1,21 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
let http = require("http");
|
let http = require("http");
|
||||||
|
let express = require("express");
|
||||||
|
let compression = require("compression");
|
||||||
let server = http.createServer();
|
let server = http.createServer();
|
||||||
|
let app = express();
|
||||||
|
server.addListener("request", app);
|
||||||
|
app.use(compression({
|
||||||
|
level: 9
|
||||||
|
}));
|
||||||
server.listen(8282,'0.0.0.0',() => {
|
server.listen(8282,'0.0.0.0',() => {
|
||||||
console.log("HTTP Service Running...");
|
console.log("HTTP Service Running...");
|
||||||
});
|
});
|
||||||
exports.http = server;
|
exports.http = server;
|
||||||
|
|
||||||
|
|
||||||
|
let {resolve} = require("path");
|
||||||
|
app.get("/script",(request, response)=>{
|
||||||
|
response.sendFile(resolve("./script/wsjs.js"))
|
||||||
|
});
|
File diff suppressed because it is too large
Load Diff
|
@ -19,6 +19,8 @@
|
||||||
"author": "Abdussamed ULUTAŞ <abdussamedulutas@yandex.com.tr>",
|
"author": "Abdussamed ULUTAŞ <abdussamedulutas@yandex.com.tr>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"compression": "^1.7.4",
|
||||||
|
"express": "^4.18.2",
|
||||||
"joi": "^17.7.0",
|
"joi": "^17.7.0",
|
||||||
"knex": "^2.3.0",
|
"knex": "^2.3.0",
|
||||||
"sqlite3": "^5.1.2",
|
"sqlite3": "^5.1.2",
|
||||||
|
|
|
@ -114,15 +114,6 @@ WSJS.prototype.sendRaw = function(obj){
|
||||||
this.ws.send(JSON.stringify(obj))
|
this.ws.send(JSON.stringify(obj))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
WSJS.prototype.checkAuth = async function(username, password){
|
|
||||||
return false;
|
|
||||||
let {value:isAuth} = await this.request({
|
|
||||||
type: 'auth/check'
|
|
||||||
});
|
|
||||||
return isAuth;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
WSJS.prototype.authWith = async function(username, password){
|
WSJS.prototype.authWith = async function(username, password){
|
||||||
await this.request({
|
await this.request({
|
||||||
type: 'auth/login',
|
type: 'auth/login',
|
Loading…
Reference in New Issue