HUB
Sign inSign up
cttpie logo

hivesolutions/cttpie

By hivesolutions

•Updated over 2 years ago

Simple API service wrapping CTT's HTML website.

Image
0

1.7K

hivesolutions/cttpie repository overview

⁠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 Docker Automated build

Tag summary

Content type

Image

Digest

sha256:0435b07c0…

Size

159.4 MB

Last updated

over 2 years ago

docker pull hivesolutions/cttpie