Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saltyaom/nhapi
nHentai API middleware, parsed for easier usage written in Nestjs.
https://github.com/saltyaom/nhapi
Last synced: 27 days ago
JSON representation
nHentai API middleware, parsed for easier usage written in Nestjs.
- Host: GitHub
- URL: https://github.com/saltyaom/nhapi
- Owner: SaltyAom
- Created: 2020-03-03T03:17:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:31:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-06T07:50:46.054Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://nhapi.opener.studio/177013
- Size: 2.73 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NhAPI
A type-enforced, beautify and performance concern middleware written in Nestjs for NHentai API.
## Wait, what, why?
Think of this repo as a community project, some might rather wanted to change NHentai API to have a better structure? I don't know, but the idea is you can self-host and cache it, even add a compression is easy when it's on your server.
* Caching
* Customizable Structure
* Compression
* Self-host (If you use cache with self-host, chance are your request would be very fast)
* Type-enforcement (Written in TypeScript)
* Fastify has better performance
* Reactive Approach (RxJS)## How to
Written with 2 important endpoint
* /:id - Get story based on provided ID
* /:related - Get 5 related story based on ID (The one at the bottom of nh)
* /search/:search - Search anything from nh.
* /:page - Turn to the specific padding of data.
### Example Usage
```javascript
fetch("https://nhapi.now.sh/177013")
.then(res => res.json())
.then(data => console.log(data))
```
By default NhAPI cached response with 24 hours ranged based on first-request or exceed cache limit.
So in practice it would be very fast to response.## Type-enforcement
A lot of thing work under the cover. Combining piece of each part which should be parsed.
I'd recommended checking out in each .dto.ts file.## Installation
```bash
$ yarn
```## Running the app
```bash
# development
$ yarn start# watch mode
$ yarn start:dev# production mode
$ yarn start:prod
```## Test
```bash
# unit tests
$ yarn test# e2e tests
$ yarn test:e2e# test coverage
$ yarn test:cov
```