Skip to content

Instantly share code, notes, and snippets.

@kenwoodjw
kenwoodjw / flask_upload.py
Created April 10, 2018 03:04
flask upload image return image base64
#coding:utf-8
import os,io
from flask import Flask, request, redirect, url_for,Response,render_template,send_file,make_response,jsonify,send_from_directory
from werkzeug import secure_filename
from flask_cors import CORS,cross_origin
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static\\upload')
@kazuma1989
kazuma1989 / app-routing.module.ts
Last active April 27, 2020 12:20
Angular Guard の動作確認と、ローディング中表示の実装
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FooComponent } from 'app/foo/foo.component';
import { BarComponent } from 'app/bar/bar.component';
import { AuthGuard } from 'app/guard/auth.guard';
import { PubComponent } from 'app/pub/pub.component';
import { NotFoundComponent } from 'app/not-found/not-found.component';
const routes: Routes = [
{