hellowhales

delete prior file

1 -FROM node:14
2 -
3 -LABEL title="TFT-Webserver"
4 -LABEL version="1.01"
5 -
6 -# set working directory
7 -WORKDIR /app
8 -
9 -# install modules and dependencies
10 -COPY package*.json ./
11 -RUN npm install
12 -
13 -# copy source codes
14 -COPY ./ ./
15 -
16 -# port-forward
17 -EXPOSE 8484
18 -
19 -#start application
20 -CMD [ "npm", "start" ]
...\ No newline at end of file ...\ No newline at end of file
1 -## 2021 - 2학기 오픈소스SW개발 프로젝트
2 ----
3 -***
4 ----
5 -
6 -## 지자체별 행사 / 축제 정보 및 날씨 제공 서비스
7 -
8 -1. Service 1 - web
9 - 1. Backend Server
10 - 1. Frontend
11 -1. Service 2 - DB
12 - 1. API로부터 받아온 정보를 관리하고 Server에 제공
13 -1. Service 3 - API Handler
14 - 1. API를 호출하여 DB에 write함
15 -
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 -
7 -var indexRouter = require('./routes/index');
8 -var usersRouter = require('./routes/users');
9 -
10 -var app = express();
11 -
12 -// view engine setup
13 -app.set('views', path.join(__dirname, 'views'));
14 -app.set('view engine', 'ejs');
15 -
16 -app.use(logger('dev'));
17 -app.use(express.json());
18 -app.use(express.urlencoded({ extended: false }));
19 -app.use(cookieParser());
20 -app.use(express.static(path.join(__dirname, 'public')));
21 -
22 -app.use('/', indexRouter);
23 -app.use('/users', usersRouter);
24 -
25 -// catch 404 and forward to error handler
26 -app.use(function(req, res, next) {
27 - next(createError(404));
28 -});
29 -
30 -// error handler
31 -app.use(function(err, req, res, next) {
32 - // set locals, only providing error in development
33 - res.locals.message = err.message;
34 - res.locals.error = req.app.get('env') === 'development' ? err : {};
35 -
36 - // render the error page
37 - res.status(err.status || 500);
38 - res.render('error');
39 -});
40 -
41 -module.exports = app;
1 -#!/usr/bin/env node
2 -
3 -/**
4 - * Module dependencies.
5 - */
6 -
7 -var app = require('../app');
8 -var debug = require('debug')('tft:server');
9 -var http = require('http');
10 -
11 -/**
12 - * Get port from environment and store in Express.
13 - */
14 -
15 -var port = normalizePort(process.env.PORT || '3000');
16 -app.set('port', port);
17 -
18 -/**
19 - * Create HTTP server.
20 - */
21 -
22 -var server = http.createServer(app);
23 -
24 -/**
25 - * Listen on provided port, on all network interfaces.
26 - */
27 -
28 -server.listen(port);
29 -server.on('error', onError);
30 -server.on('listening', onListening);
31 -
32 -/**
33 - * Normalize a port into a number, string, or false.
34 - */
35 -
36 -function normalizePort(val) {
37 - var port = parseInt(val, 10);
38 -
39 - if (isNaN(port)) {
40 - // named pipe
41 - return val;
42 - }
43 -
44 - if (port >= 0) {
45 - // port number
46 - return port;
47 - }
48 -
49 - return false;
50 -}
51 -
52 -/**
53 - * Event listener for HTTP server "error" event.
54 - */
55 -
56 -function onError(error) {
57 - if (error.syscall !== 'listen') {
58 - throw error;
59 - }
60 -
61 - var bind = typeof port === 'string'
62 - ? 'Pipe ' + port
63 - : 'Port ' + port;
64 -
65 - // handle specific listen errors with friendly messages
66 - switch (error.code) {
67 - case 'EACCES':
68 - console.error(bind + ' requires elevated privileges');
69 - process.exit(1);
70 - break;
71 - case 'EADDRINUSE':
72 - console.error(bind + ' is already in use');
73 - process.exit(1);
74 - break;
75 - default:
76 - throw error;
77 - }
78 -}
79 -
80 -/**
81 - * Event listener for HTTP server "listening" event.
82 - */
83 -
84 -function onListening() {
85 - var addr = server.address();
86 - var bind = typeof addr === 'string'
87 - ? 'pipe ' + addr
88 - : 'port ' + addr.port;
89 - debug('Listening on ' + bind);
90 -}
1 -.DS_Store
2 -thumbs.db
3 -*.log
4 -node_modules/
...\ No newline at end of file ...\ No newline at end of file
1 -body {
2 - padding: 50px;
3 - font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 -}
5 -
6 -a {
7 - color: #00B7FF;
8 -}
1 -var express = require('express');
2 -var router = express.Router();
3 -
4 -/* GET home page. */
5 -router.get('/', function(req, res, next) {
6 - res.render('index', { title: 'Express' });
7 -});
8 -
9 -module.exports = router;
1 -var express = require('express');
2 -var router = express.Router();
3 -
4 -/* GET users listing. */
5 -router.get('/', function(req, res, next) {
6 - res.send('respond with a resource');
7 -});
8 -
9 -module.exports = router;
1 -<h1><%= message %></h1>
2 -<h2><%= error.status %></h2>
3 -<pre><%= error.stack %></pre>
1 -<!DOCTYPE html>
2 -<html>
3 - <head>
4 - <title><%= title %></title>
5 - <link rel='stylesheet' href='/stylesheets/style.css' />
6 - </head>
7 - <body>
8 - <h1><%= title %></h1>
9 - <p>Welcome to <%= title %></p>
10 - </body>
11 -</html>