https://github.com/switcherapi/switcher-searchdocs
SearchDocs API powered by Deno, Oak and Skimming Module
https://github.com/switcherapi/switcher-searchdocs
deno oak skimming
Last synced: 11 months ago
JSON representation
SearchDocs API powered by Deno, Oak and Skimming Module
- Host: GitHub
- URL: https://github.com/switcherapi/switcher-searchdocs
- Owner: switcherapi
- License: mit
- Created: 2023-09-17T22:41:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-08T21:17:44.000Z (11 months ago)
- Last Synced: 2025-03-08T22:21:02.276Z (11 months ago)
- Topics: deno, oak, skimming
- Language: TypeScript
- Homepage:
- Size: 146 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
***
Switcher SearchDocs API
A remote document search engine that uses Skimming for Deno
[](https://github.com/switcherapi/switcher-searchdocs/actions/workflows/master.yml)
[](https://sonarcloud.io/dashboard?id=switcherapi_switcher-searchdocs)
[](https://hub.docker.com/r/trackerforce/switcher-searchdocs)
[](https://opensource.org/licenses/MIT)
[](https://switcher-hq.slack.com/)
***
# About
Switcher SearchDocs API uses [Skimming](https://github.com/petruki/skimming) and [Oak Middleware](https://github.com/oakserver/oak) modules to deliver a simple and efficient search engine.
## Running locally
1. Clone the repository
2. Run `deno task run:dev` or test with `deno task test`
3. Happy Deno hacking with SearchDocs!
## Usage
### Lockup API info
```
Request (GET)
{{url}}/api/check
```
**Sample response**
```json
{
"status": "ok",
"releaseTime": "today",
"sslEnabled": false,
"appSettings": {
"url": "https://raw.githubusercontent.com/petruki/skimming/master/",
"files": "README.md",
"cacheExpDuration": "5",
"cacheSize": "100"
}
}
```
### From local content
```
Request (GET)
{{url}}/?query=Usage&previewLength=-1&ignoreCase=false&trimContent=true
```
- query: value to search
- previewLength: length of the content to be returned
- When 0: it shows only the matched word
- When -1: it shows the entire content from the first match
- ignoreCase: ignore case
- trimContent: prettify the response segment, basically
- regex: enable regular expression searching method
- skipCache: skip cache
**Sample response**
```json
{
"message": "Success",
"query": "Sk",
"result": [
{
"file": "README.md",
"segment": [
"Skimming is a data fetcher for Deno. The idea is to provide a simple and efficient module to fetch content.",
"Skimming from \"https://raw.githubusercontent.com/petruki/skimming/v1.0.0/mod.ts\";",
"Skimming({ expireDuration: 10, size: 10 });"
],
"found": 3,
"cache": true
}
]
}
```
### From remote content
```
Request (GET)
{{url}}/?url=https://raw.githubusercontent.com/denoland/deno/main/&files=README.md
```
- url: Endpoint to be fetched
- files: artifacts to be fetched