코드를 확인하고 터미널을 열고 디렉토리로 이동하십시오. Windows 사용자 가이드
docker build . -t alexandria-api
docker container run --name alexandria-api -p 8080:80 -p 8081:81 -v ${PWD}:/alexandria-api -it -d alexandria-api
docker exec -it alexandria-api /bin/bash
/alexandria-api/scripts/init-docker.sh
http://127.0.0.1:8080으로 이동하여 개발을 시작하십시오.
데이터베이스에 액세스하고 편집하려면 http://127.0.1:8081로 이동하십시오.
실행 테스트 :
./phpunit --bootstrap functions.php tests
## API Endpoints
### Search
https://api.alexandria.org/?q=test%20Query&p=1&a=1&c=a
Parameters:
Q : 쿼리 P : 페이지 번호 1 ~ 10 a : 익명 검색의 경우 기본 동작 1의 경우 익명 플래그, 0. C : 클러스터 (A 또는 B)
Response:
{ "status": "success", "time_ms": 535.438060760498, "total_found": 105245, "page_max": 10, "results": [{ "url": "https://github.com/": "github", "snippet": ",", "," "스코어": 32.5283701133728, "domain_hash": "5468486186948880458", "url_hash": "5468481278583313044", "정확한 _match": 0, "phrase_match": 2, "999,"IS ": "is_subdomain": 0, "domain": "github.com", "display_url": "https://github.com/dannote/recattle"}}}
### Query URL
https://api.alexandria.org/url?u=http://example.com&c=a
Parameters:
U : 클러스터 C : 클러스터 (A 또는 B)에 있는지 확인하는 URL
Response:
{ "상태": "성공", "결과": "... TSV 데이터 ..."}