이정민

add keys

# Created by https://www.gitignore.io/api/node
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
keys/api_option.js
keys/db_option.js
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# End of https://www.gitignore.io/api/node
\ No newline at end of file
ProbabilityDeath @ ec58beff
Subproject commit ec58beff037eb5965c06133abbaeb0cf4abb6c65
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express(),
server= require('http').createServer(app),
SOCKETIO=require('./lib/socketio.js');
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use('/',express.static(path.join(__dirname, 'public')));
app.use('/',express.static(path.join(__dirname, 'code')));
app.use('/name/:name/birth',express.static(path.join(__dirname, 'public')));
app.use('/name/:name/birth',express.static(path.join(__dirname, 'code')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
server.listen(80);
SOCKETIO(server,app);
module.exports = app;

23.9 KB

No preview for this file type
This diff is collapsed. Click to expand it.
{
"name": "project",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "^1.18.3",
"compression": "^1.7.3",
"cookie-parser": "~1.4.3",
"date-utils": "^1.2.21",
"debug": "~2.6.9",
"ejs": "~2.5.7",
"express": "~4.16.0",
"helmet": "^3.21.2",
"http-errors": "~1.6.2",
"morgan": "~1.9.0",
"mysql": "^2.16.0",
"request": "^2.88.0",
"socket.io": "^2.1.1"
}
}