GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DomainManager/server.js at master · Caibiy/DomainManager

Expand file tree

/

server.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
47 lines (38 loc) · 1.18 KB
/

server.js

Copy path

File metadata and controls

47 lines (38 loc) · 1.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Voting Application
* @authors JiaDongYang
* @date 2017-04-15 16:48:15
* @version 1.0.0
*/
const express =require('express'),
bodyPareser=require('body-parser'),
passport=require('passport'),
path=require('path'),
mongoose=require('mongoose'),
cors=require('cors');
var app= express(),
config=require('./config'),
routes=require('./routes/index'),
domain=require('./routes/domain')
local=require('./auth/local');
mongoose.connect(config.database);
mongoose.connection.on('connected',function(){
console.log('Database is connected: '+config.database);
});
mongoose.connection.on('error',function(error){
console.log('Database error:'+error);
});
app.use(bodyPareser.json());
app.use(passport.initialize());
app.use(passport.session());
local(passport);
app.use(express.static(path.join(__dirname,'client')));
app.use(cors());
app.use('/api',routes);
app.use('/api/domain',domain);
app.get('*',(req,res)=>{
res.sendfile(path.join(__dirname, 'client/index.html'));//此处必须这样写 要不然url输入显示错误
})
app.listen(config.port,function(){
console.log('app is running on '+config.port);
});
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.