Maj packages
This commit is contained in:
3
.vscode/settings.json
vendored
Executable file
3
.vscode/settings.json
vendored
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"docker.commands.build": "${containerCommand} build --rm -f \"${dockerfile}\" -t bot_laytho:latest \"${context}\""
|
||||||
|
}
|
||||||
28
.vscode/tasks.json
vendored
28
.vscode/tasks.json
vendored
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
|
||||||
{
|
|
||||||
"type": "docker-build",
|
|
||||||
"label": "Build Node Image",
|
|
||||||
"platform": "node",
|
|
||||||
"dockerBuild": {
|
|
||||||
"dockerfile": "${workspaceFolder}/Dockerfile",
|
|
||||||
"context": "${workspaceFolder}",
|
|
||||||
"pull": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "docker-run",
|
|
||||||
"label": "Run Node Image",
|
|
||||||
"platform": "node",
|
|
||||||
"dockerRun": {
|
|
||||||
"containerName": "BotTwitch-Laytho",
|
|
||||||
"restart": "always",
|
|
||||||
"network": "host"
|
|
||||||
},
|
|
||||||
"dependsOn": [
|
|
||||||
"docker-build"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
10
Dockerfile
10
Dockerfile
@@ -1,10 +1,14 @@
|
|||||||
FROM node:latest
|
FROM node:alpine as base
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
COPY ["package.json", "package-lock.json*", "./"]
|
COPY ["package.json", "package-lock.json*", "./"]
|
||||||
RUN npm install --production --silent && mv node_modules ../
|
RUN npm install --production --verbose && mv node_modules ../
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN chown -R node /usr/src/app
|
RUN chown -R node /usr/src/app
|
||||||
USER node
|
USER node
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "start"]
|
||||||
18
package.json
Normal file → Executable file
18
package.json
Normal file → Executable file
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bot_laytho",
|
"name": "bot_laytho",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "bot_Laytho",
|
"description": "bot_Laytho",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -12,17 +12,17 @@
|
|||||||
"name": "Angels / Jojo"
|
"name": "Angels / Jojo"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.40.0",
|
"eslint": "^9.8.0",
|
||||||
"nodemon": "^2.0.22",
|
"nodemon": "^3.1.4",
|
||||||
"prettier": "^2.8.8"
|
"prettier": "^3.3.3"
|
||||||
},
|
},
|
||||||
"eslintConfig": {},
|
"eslintConfig": {},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.7.3",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.4.5",
|
||||||
"express": "^4.18.2",
|
"express": "^4.19.2",
|
||||||
"mysql2": "^3.3.0",
|
"mysql2": "^3.11.0",
|
||||||
"require-all": "^3.0.0",
|
"require-all": "^3.0.0",
|
||||||
"websocket": "^1.0.34"
|
"websocket": "^1.0.35"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
utils/oauthGen.js
Normal file → Executable file
1
utils/oauthGen.js
Normal file → Executable file
@@ -1,5 +1,4 @@
|
|||||||
module.exports = oauthGen = (async (client_id, redirect_uri, scope) => {
|
module.exports = oauthGen = (async (client_id, redirect_uri, scope) => {
|
||||||
console.log(scope)
|
|
||||||
let queries = {
|
let queries = {
|
||||||
response_type: 'code',
|
response_type: 'code',
|
||||||
client_id,
|
client_id,
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ module.exports = validateToken = (async (access_token) => {
|
|||||||
}
|
}
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
return true
|
return true
|
||||||
}).catch(error => { console.error(error.response.data) })
|
}).catch(error => { if (error.response.data.message == 'invalid access token') console.error(error.response.data) })
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user