최원석3 [goesnow]

edit routing

# check your instagram!
# Check your instagram!
```
Lookup ID, and Compare!
## Execute server
```shell
python -m pipenv shell
python server.py
```
## Execute only frontend
[link](https://github.com/1Seok2/check-your-instagram/tree/master/app)
......
......@@ -16,3 +16,8 @@ npm run start
```
`npm run start`만 진행할 시 수정사항이 적용되지 않음
### 최종 빌드 진행
```shell
npm run predeploy
```
\ No newline at end of file
......
const gulp = require('gulp');
const browserify = require('browserify');
const watchify = require('watchify');
const errorify = require('errorify');
const del = require('del');
const tsify = require('tsify');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const runSequence = require('run-sequence');
const uglify = require('gulp-uglify');
gulp.task('clean', () => {
return del('./built/**/*')
});
gulp.task('prod', () => {
browserify({
basedir: '.',
debug: true,
entries: ['src'],
cache: {},
packageCache: {}
})
.plugin(tsify)
.bundle()
.pipe(source('bundle.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('built'));
});
gulp.task('dev', () => {
browserify({
basedir: '.',
debug: true,
entries: ['src'],
cache: {},
packageCache: {}
})
.plugin(tsify)
.plugin(watchify)
.plugin(errorify)
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('built'));
});
gulp.task('default', (done) => {
runSequence('clean', 'dev', () => {
console.log('Watching...')
gulp.watch(['src/**/*.ts'],
['dev']);
});
});
gulp.task('package', (done) => {
runSequence('clean', 'prod', () => {
console.log('Watching...')
gulp.watch(['src/**/*.ts'],
['prod']);
});
});
......@@ -19,7 +19,8 @@
"posttest": "npm.cmd run lint",
"compile": "tsc -w",
"build": "webpack --watch",
"start": "webpack serve --open"
"start": "webpack serve --open",
"predeploy" : "webpack"
},
"devDependencies": {
"@types/node": "^14.11.2",
......
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')
@app.route("/")
def home():
# return render_template('index.html')
return send_from_directory('./app','index.html')
@app.route("/update", methods=["GET"])
def update():
insta_id = request.args.get('insta_id')
def update(insta_id):
crawler_instagram(insta_id)
data = {
......@@ -27,9 +17,16 @@ def update():
}
return jsonify(data)
@app.route("/hello", methods=["GET"])
def hello():
return "hello"
@app.route("/", defaults={"path": ""})
@app.route("/<path:path>")
def home(path):
# return render_template('index.html')
if path == 'update':
insta_id = request.args.get('insta_id')
update(insta_id)
else :
return send_from_directory('./app/public/', 'index.html')
if __name__ == "__main__":
......