-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (20 loc) · 660 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// import
const Express = require('express')
const Dotenv = require('dotenv')
const Bodyparser = require('body-parser')
const { httpServer } = require('./servers')
const ServerJS = require('tofa-server-js')
// general config
Dotenv.config()
ServerJS.init('127.0.0.1:9050')
// express app
const App = Express()
App.use(Bodyparser.json())
App.use('/', (req, res, next)=>{
res.set('onion-location', 'http://7o5hh2f6gdxusghkqphrgwhs3xjqogakmusscbs4ektjv42sqeft4iqd.onion')
next()
})
App.disable('x-powered-by');
App.use(require('./routes'))
// server part
httpServer(App).listen("3000", '127.0.0.1', console.log(`Server listening on 127.0.0.1:3000`))