Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최원석
/
2021-1-database-project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
1seok2
2021-03-08 19:29:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0f8f0a0dd458e5904017758450e0c4abbce211fa
0f8f0a0d
1 parent
099bf65f
resolve problem of path
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
20 deletions
app/package.json
app/src/index.html
app/webpack.config.js
server.py
app/package.json
View file @
0f8f0a0
...
...
@@ -14,13 +14,10 @@
"lint"
:
"gts lint"
,
"clean"
:
"gts clean"
,
"fix"
:
"gts fix"
,
"prepare"
:
"npm.cmd run compile"
,
"pretest"
:
"npm.cmd run compile"
,
"posttest"
:
"npm.cmd run lint"
,
"compile"
:
"tsc -w"
,
"build"
:
"webpack --watch"
,
"start"
:
"webpack serve --open"
,
"predeploy"
:
"webpack"
"predeploy"
:
"webpack"
},
"devDependencies"
:
{
"@types/node"
:
"^14.11.2"
,
...
...
app/src/index.html
View file @
0f8f0a0
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<base
href=
"/"
/>
<meta
charset=
"UTF-8"
>
<title>
home
</title>
</head>
<body>
<div
id=
"App"
></div>
<div
id=
"App"
>
</div>
<!-- <script src="public/main.js" ></script>-->
</body>
</html>
\ No newline at end of file
...
...
app/webpack.config.js
View file @
0f8f0a0
...
...
@@ -5,7 +5,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
module
.
exports
=
{
mode
:
'development'
,
entry
:
{
// main : './build/src/index.js'
main
:
'./src/index.ts'
},
module
:
{
...
...
@@ -23,7 +22,8 @@ module.exports = {
test
:
/
\.(
png|jpe
?
g|gif|jp2|webp
)
$/
,
loader
:
'file-loader'
,
options
:
{
name
:
'images/[name].[ext]'
name
:
'images/[name].[ext]'
,
publicPath
:
'public/'
},
}
]
...
...
@@ -32,8 +32,8 @@ module.exports = {
extensions
:
[
".tsx"
,
".ts"
,
".js"
],
},
output
:
{
publicPath
:
'/
app/public
'
,
path
:
path
.
resolve
(
'./public'
),
publicPath
:
'/
public/
'
,
path
:
path
.
resolve
(
'./public
/
'
),
filename
:
'[name].js'
,
},
devServer
:
{
...
...
@@ -46,7 +46,7 @@ module.exports = {
}
},
plugins
:
[
new
CleanWebpackPlugin
(),
//
new CleanWebpackPlugin(),
new
HtmlWebpackPlugin
({
template
:
'./src/index.html'
})
...
...
server.py
View file @
0f8f0a0
...
...
@@ -2,12 +2,8 @@ import os
from
flask
import
Flask
,
render_template
,
request
,
jsonify
,
send_from_directory
from
crawler.crawler_instagram
import
crawler_instagram
app
=
Flask
(
__name__
)
@app.errorhandler
(
404
)
def
page_not_found
():
return
render_template
(
'404.html'
)
my_path
=
'/Users/choewonseog/Documents/check-your-instagram/app/public'
app
=
Flask
(
__name__
,
static_folder
=
os
.
path
.
abspath
(
my_path
))
def
update
(
insta_id
):
crawler_instagram
(
insta_id
)
...
...
@@ -18,16 +14,28 @@ def update(insta_id):
return
jsonify
(
data
)
@app.errorhandler
(
404
)
def
page_not_found
():
return
render_template
(
'404.html'
)
@app.route
(
"/"
,
defaults
=
{
"path"
:
""
})
@app.route
(
"/<path:path>"
)
def
home
(
path
):
# return render_template('index.html')
print
(
"hi? your in '
%
s' !!"
%
(
path
))
# if path != "" and os.path.exists(app.static_folder + '/' + path):
# return send_from_directory(app.static_folder, path)
# else:
# return send_from_directory(app.static_folder, 'index.html')
if
path
==
'update'
:
insta_id
=
request
.
args
.
get
(
'insta_id'
)
update
(
insta_id
)
else
:
return
send_from_directory
(
'./app/public/'
,
'index.html'
)
elif
path
==
''
:
root_dir
=
os
.
path
.
dirname
(
os
.
getcwd
())
return
send_from_directory
(
os
.
path
.
join
(
root_dir
,
'check-your-instagram'
,
'app'
,
'public'
),
filename
=
'index.html'
)
return
render_template
(
'index.html'
)
# else:
# return render_template('index.html')
if
__name__
==
"__main__"
:
print
(
"-"
*
60
)
...
...
Please
register
or
login
to post a comment