Showing
7 changed files
with
152 additions
and
1 deletions
.gitignore
0 → 100644
1 | + | ||
2 | +# Created by https://www.gitignore.io/api/node | ||
3 | + | ||
4 | +### Node ### | ||
5 | +# Logs | ||
6 | +logs | ||
7 | +*.log | ||
8 | +npm-debug.log* | ||
9 | +yarn-debug.log* | ||
10 | +yarn-error.log* | ||
11 | + | ||
12 | +# Runtime data | ||
13 | +pids | ||
14 | +*.pid | ||
15 | +*.seed | ||
16 | +*.pid.lock | ||
17 | + | ||
18 | +# Directory for instrumented libs generated by jscoverage/JSCover | ||
19 | +lib-cov | ||
20 | + | ||
21 | +# Coverage directory used by tools like istanbul | ||
22 | +coverage | ||
23 | + | ||
24 | +# nyc test coverage | ||
25 | +.nyc_output | ||
26 | + | ||
27 | +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
28 | +.grunt | ||
29 | + | ||
30 | +# Bower dependency directory (https://bower.io/) | ||
31 | +bower_components | ||
32 | + | ||
33 | +# node-waf configuration | ||
34 | +.lock-wscript | ||
35 | + | ||
36 | +# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
37 | +build/Release | ||
38 | + | ||
39 | +# Dependency directories | ||
40 | +node_modules/ | ||
41 | +jspm_packages/ | ||
42 | +keys/api_option.js | ||
43 | +keys/db_option.js | ||
44 | +# TypeScript v1 declaration files | ||
45 | +typings/ | ||
46 | + | ||
47 | +# Optional npm cache directory | ||
48 | +.npm | ||
49 | + | ||
50 | +# Optional eslint cache | ||
51 | +.eslintcache | ||
52 | + | ||
53 | +# Optional REPL history | ||
54 | +.node_repl_history | ||
55 | + | ||
56 | +# Output of 'npm pack' | ||
57 | +*.tgz | ||
58 | + | ||
59 | +# Yarn Integrity file | ||
60 | +.yarn-integrity | ||
61 | + | ||
62 | +# dotenv environment variables file | ||
63 | +.env | ||
64 | + | ||
65 | +# parcel-bundler cache (https://parceljs.org/) | ||
66 | +.cache | ||
67 | + | ||
68 | +# next.js build output | ||
69 | +.next | ||
70 | + | ||
71 | +# nuxt.js build output | ||
72 | +.nuxt | ||
73 | + | ||
74 | +# vuepress build output | ||
75 | +.vuepress/dist | ||
76 | + | ||
77 | +# Serverless directories | ||
78 | +.serverless | ||
79 | + | ||
80 | + | ||
81 | +# End of https://www.gitignore.io/api/node | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
ProbabilityDeath @ ec58beff
1 | -Subproject commit ec58beff037eb5965c06133abbaeb0cf4abb6c65 |
app.js
0 → 100644
1 | +var createError = require('http-errors'); | ||
2 | +var express = require('express'); | ||
3 | +var path = require('path'); | ||
4 | +var cookieParser = require('cookie-parser'); | ||
5 | +var logger = require('morgan'); | ||
6 | +var indexRouter = require('./routes/index'); | ||
7 | +var usersRouter = require('./routes/users'); | ||
8 | + | ||
9 | +var app = express(), | ||
10 | +server= require('http').createServer(app), | ||
11 | +SOCKETIO=require('./lib/socketio.js'); | ||
12 | + | ||
13 | +// view engine setup | ||
14 | +app.set('views', path.join(__dirname, 'views')); | ||
15 | +app.set('view engine', 'ejs'); | ||
16 | + | ||
17 | +app.use(logger('dev')); | ||
18 | +app.use(express.json()); | ||
19 | +app.use(express.urlencoded({ extended: false })); | ||
20 | +app.use(cookieParser()); | ||
21 | +app.use('/',express.static(path.join(__dirname, 'public'))); | ||
22 | +app.use('/',express.static(path.join(__dirname, 'code'))); | ||
23 | +app.use('/name/:name/birth',express.static(path.join(__dirname, 'public'))); | ||
24 | +app.use('/name/:name/birth',express.static(path.join(__dirname, 'code'))); | ||
25 | + | ||
26 | +app.use('/', indexRouter); | ||
27 | +app.use('/users', usersRouter); | ||
28 | + | ||
29 | +// catch 404 and forward to error handler | ||
30 | +app.use(function(req, res, next) { | ||
31 | + next(createError(404)); | ||
32 | +}); | ||
33 | + | ||
34 | +// error handler | ||
35 | +app.use(function(err, req, res, next) { | ||
36 | + // set locals, only providing error in development | ||
37 | + res.locals.message = err.message; | ||
38 | + res.locals.error = req.app.get('env') === 'development' ? err : {}; | ||
39 | + | ||
40 | + // render the error page | ||
41 | + res.status(err.status || 500); | ||
42 | + res.render('error'); | ||
43 | +}); | ||
44 | + | ||
45 | +server.listen(80); | ||
46 | +SOCKETIO(server,app); | ||
47 | + | ||
48 | +module.exports = app; |
db.png
0 → 100644
23.9 KB
mysql.mwb
0 → 100644
No preview for this file type
package-lock.json
0 → 100644
This diff is collapsed. Click to expand it.
package.json
0 → 100644
1 | +{ | ||
2 | + "name": "project", | ||
3 | + "version": "0.0.0", | ||
4 | + "private": true, | ||
5 | + "scripts": { | ||
6 | + "start": "node ./bin/www" | ||
7 | + }, | ||
8 | + "dependencies": { | ||
9 | + "body-parser": "^1.18.3", | ||
10 | + "compression": "^1.7.3", | ||
11 | + "cookie-parser": "~1.4.3", | ||
12 | + "date-utils": "^1.2.21", | ||
13 | + "debug": "~2.6.9", | ||
14 | + "ejs": "~2.5.7", | ||
15 | + "express": "~4.16.0", | ||
16 | + "helmet": "^3.21.2", | ||
17 | + "http-errors": "~1.6.2", | ||
18 | + "morgan": "~1.9.0", | ||
19 | + "mysql": "^2.16.0", | ||
20 | + "request": "^2.88.0", | ||
21 | + "socket.io": "^2.1.1" | ||
22 | + } | ||
23 | +} |
-
Please register or login to post a comment