forked from deepwel/Chinese-Annotator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify apis.md document, and add a web to api test (deepwel#23)
* add the counter to make the index page can work * 1. add web-util.thml so the user can use the web to test the provided api service. 2. modify the apis document add the api description,
- Loading branch information
Showing
6 changed files
with
244 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
<title>anatine - a free css template</title> | ||
<link rel="stylesheet" href="styles.css" type="text/css" /> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" /> | ||
</head> | ||
|
||
<body> | ||
<section id="body" class="width"> | ||
<aside id="sidebar" class="column-left"> | ||
|
||
<header> | ||
<h1> | ||
<a href="#">anatine</a> | ||
</h1> | ||
|
||
<h2>Welcome to canno chinese annotator!!</h2> | ||
|
||
</header> | ||
|
||
<nav id="mainnav"> | ||
<ul> | ||
<li> | ||
<a href="index.html">Home</a> | ||
</li> | ||
<li class="selected-item"> | ||
<a href="examples.html">Examples</a> | ||
</li> | ||
<li> | ||
<a href="text_classification.html">Text Classification</a> | ||
</li> | ||
<li> | ||
<a href="web_util.html">web api util</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
|
||
|
||
</aside> | ||
<section id="content" class="column-right"> | ||
|
||
<article> | ||
<h3>API Testing</h3> | ||
|
||
<blockquote> | ||
<p>this web is for API testing, it list all API that provided by the web service backend. user can use this web site | ||
to access the web api send GET or POST request</p> | ||
</blockquote> | ||
|
||
|
||
<h3>Load Local Data</h3> | ||
<!--<div class="article-info">Posted on <time datetime="2013-05-14">14 May</time> by <a href="#" rel="author">Joe Bloggs</a></div>--> | ||
<div id="load_local_data"> | ||
<label></label> | ||
<input type="text" size="50" v-model="file_path"/> | ||
<button class="formbutton" v-on:click="load_local_data_post">load local data by POST</button> | ||
<button class="formbutton" v-on:click="load_local_data_get">load local data by GET</button> | ||
<p>{{ message }}</p> | ||
</div> | ||
|
||
|
||
</article> | ||
|
||
|
||
<footer class="clear"> | ||
<p>© 2017 sitename. | ||
<a href="http://zypopwebtemplates.com/">Free CSS Templates</a> by ZyPOP</p> | ||
</footer> | ||
|
||
</section> | ||
|
||
<div class="clear"></div> | ||
|
||
</section> | ||
|
||
|
||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | ||
<script src="https://unpkg.com/vue"></script> | ||
<script src="js/core.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
#API 文档 | ||
|
||
## 如何启动web和Reset API 服务 | ||
本框架使用前后端分离,所以要分别启动前端的页面和后端的web服务 | ||
|
||
### 启动前端页面 | ||
前端使用纯前端技术,不需要后端之前就可以运行 | ||
|
||
运行方式: | ||
1. 直接使用浏览器打开*.html | ||
2. 使用Apache http service,使用这种方式只需要修改apache服务器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,将其修改为Chinese-Annotator\chi_annotator\webui\static。然后重启httpd服务器,直接访问localhost即可 | ||
|
||
### 后端服务的启动 | ||
后端使用Python的flask,所以需要安装必要的包,所需要的依赖包参见项目目录中的requirements.txt | ||
1. 将/webui export到PYTHONPATH | ||
2. 运行 python ca.py | ||
|
||
|
||
## API 接口说明 | ||
/load_local_dataset | ||
|
||
支持post和get请求 | ||
参数:filepath 本地文件的绝对路径 | ||
|
||
功能: 将本地的文件load到Mongo数据库 |