0.5.1 • Published 2 months ago

cttpie v0.5.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
2 months ago

CTTPie

Simple API service wrapping CTT's HTML website.

Rational

It should make use of the regular CTT website to get tracking information, but in a more programmatic way.

The underlying code should mek use of the node-fetch and node-html-parser packages to make requests to the CTT website and parse them.

Usage

The package can be used in a simple way, by just calling the root endpoint (/) with a tracking number (tracking) as a GET parameter.

yarn dev
curl -X GET http://localhost:3000/?tracking=RR123456789PT

Configuration

NameTypeDefaultDescription
CTTPIE_KEYstrNoneSecret key that should be passed in protected calls so that the server side "trusts" the client side (authentication).
CTTPIE_HANDLERstrneoThe handler that is going to be used to find and process tracking numbers (eg: neo, legacy).
API_VERSIONstrNoneSecret Base64 CTT API version to be used in API requests.
CSRF_TOKENstrNoneSecret CSRF token to be used for CTT API.
COOKIEstrNoneSecret cookie to be used for CTT API authentication.

License

CTTPie is currently licensed under the Apache License, Version 2.0.

Build Automation

Build Status Build Status GitHub npm Status License