Browse Source

update ip

pull/1/head
asyncnomi 3 years ago
parent
commit
d2cfeb7b82
  1. 3
      README.md
  2. 6
      index.js

3
README.md

@ -4,10 +4,11 @@
1. Requirements: 1. Requirements:
* Create a bde-list user in sudoers: `useradd -m -s /bin/bash -G sudo bde-list` and connect to it. * Create a bde-list user in sudoers: `sudo useradd -m -s /bin/bash -G sudo bde-list` and connect to it.
* Install nvm: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash` * Install nvm: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash`
* Install node: `nvm install 18.12.1 && nvm use 18.12.1` * Install node: `nvm install 18.12.1 && nvm use 18.12.1`
* Install pm2: `npm install pm2 -g` * Install pm2: `npm install pm2 -g`
* Install nginx: `sudo apt-get install nginx`
2. Installation: 2. Installation:

6
index.js

@ -42,6 +42,10 @@ fastify.register(require('@fastify/static'), {
decorateReply: false decorateReply: false
}) })
fastify.get('/', async (request, reply) => {
})
fastify.post('/login', async (request, reply) => { fastify.post('/login', async (request, reply) => {
let content = request.body; let content = request.body;
if (content.hasOwnProperty("user") if (content.hasOwnProperty("user")
@ -347,7 +351,7 @@ function makeid(length) {
const start = async () => { const start = async () => {
try { try {
await fastify.listen({ port: 3000 }) await fastify.listen({ port: 3000 , host: '0.0.0.0',})
} catch (err) { } catch (err) {
fastify.log.error(err) fastify.log.error(err)
LDAP.close(function(err) { LDAP.close(function(err) {

Loading…
Cancel
Save