최원석3 [goesnow]

add frontend server

...@@ -5,6 +5,7 @@ chromedriver ...@@ -5,6 +5,7 @@ chromedriver
5 5
6 app/**/*.map 6 app/**/*.map
7 app/**/*.js 7 app/**/*.js
8 +build
8 9
9 key.py 10 key.py
10 admin.py 11 admin.py
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
11 <excludeFolder url="file://$MODULE_DIR$/venv" /> 11 <excludeFolder url="file://$MODULE_DIR$/venv" />
12 <excludeFolder url="file://$MODULE_DIR$/venv3" /> 12 <excludeFolder url="file://$MODULE_DIR$/venv3" />
13 </content> 13 </content>
14 - <orderEntry type="jdk" jdkName="Python 3.8 (venv3)" jdkType="Python SDK" /> 14 + <orderEntry type="jdk" jdkName="Python 3.7 (check-your-instagram)" jdkType="Python SDK" />
15 <orderEntry type="sourceFolder" forTests="false" /> 15 <orderEntry type="sourceFolder" forTests="false" />
16 </component> 16 </component>
17 </module> 17 </module>
...\ No newline at end of file ...\ No newline at end of file
......
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4"> 2 <project version="4">
3 - <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (venv3)" project-jdk-type="Python SDK" /> 3 + <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (check-your-instagram)" project-jdk-type="Python SDK" />
4 </project> 4 </project>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -7,7 +7,16 @@ typescript만으로 작성 ...@@ -7,7 +7,16 @@ typescript만으로 작성
7 npx gts init 7 npx gts init
8 ``` 8 ```
9 9
10 +# 개발
11 +
10 ### 프로젝트 dev 모드 12 ### 프로젝트 dev 모드
11 ```shell 13 ```shell
12 tsc -w 14 tsc -w
13 ``` 15 ```
16 +
17 +### 프론트 서버 띄우기
18 +```shell
19 +npm install -g http-server
20 +cd ./app
21 +http-server ./
22 +```
...\ No newline at end of file ...\ No newline at end of file
......
1 +<!DOCTYPE html>
2 +<html lang="en">
3 +<head>
4 + <meta charset="UTF-8">
5 + <title>Title</title>
6 +</head>
7 +<body>
8 + <div id="App"></div>
9 + <script>var exports = {};</script>
10 + <script src="build/src/index.js" ></script>
11 +</body>
12 +</html>
...\ No newline at end of file ...\ No newline at end of file
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
17 "fix": "gts fix", 17 "fix": "gts fix",
18 "prepare": "npm.cmd run compile", 18 "prepare": "npm.cmd run compile",
19 "pretest": "npm.cmd run compile", 19 "pretest": "npm.cmd run compile",
20 - "posttest": "npm.cmd run lint" 20 + "posttest": "npm.cmd run lint",
21 + "build": "tsc --build",
22 + "dev": "tsc -w"
21 }, 23 },
22 "devDependencies": { 24 "devDependencies": {
23 "@types/node": "^14.11.2", 25 "@types/node": "^14.11.2",
......
1 -console.log('Try npm run lint/fix!'); 1 +const hi = 'hi';
2 2
3 -const longString = 3 +export const hi1 = () => {
4 - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut aliquet diam.'; 4 + console.log(hi);
5 +};
5 6
6 -const trailing = 'Semicolon'; 7 +hi1();
7 -
8 -const why = 'am I tabbed?';
9 -
10 -export function doSomeStuff(
11 - withThis: string,
12 - andThat: string,
13 - andThose: string[]
14 -) {
15 - //function on one line
16 - if (!andThose.length) {
17 - return false;
18 - }
19 - console.log(withThis);
20 - console.log(andThat);
21 - console.dir(andThose);
22 - return;
23 -}
24 -// TODO: more examples
...\ No newline at end of file ...\ No newline at end of file
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
1 import os 1 import os
2 -from flask import Flask, render_template, request, jsonify 2 +from flask import Flask, render_template, request, jsonify, send_from_directory
3 3
4 from crawler.crawler_instagram import crawler_instagram 4 from crawler.crawler_instagram import crawler_instagram
5 5
...@@ -13,7 +13,8 @@ def page_not_found(): ...@@ -13,7 +13,8 @@ def page_not_found():
13 13
14 @app.route("/") 14 @app.route("/")
15 def home(): 15 def home():
16 - return render_template('index.html') 16 + # return render_template('index.html')
17 + return send_from_directory('./app','index.html')
17 18
18 19
19 @app.route("/update", methods=["GET"]) 20 @app.route("/update", methods=["GET"])
......