Atomic Web Service (AWS, REST API) for converting text from UTF-8 to WIN-1251, powered by iconv-lite and Node.js
Part of the "Personal Research Information System" atomic web services ecosystem.
Program runs on modern MacOS and Linux distributions. To run program you will need:
For Ubuntu Server Linux distribution
$ git clone https://github.com/malakhovks/utf8-to-win1251-api.git
$ npm install
Run program in development mode (default port: 3002; log-mode: development). Winston logging level will be set to debug and transport debug/info/warning logs to Console:
$ npm run start-development
You can set port in ./config/development.json:
{
"port": 3002,
"log-mode": "development"
}
Run program in production mode (default port: 3002; log-mode: production). Winston logging level will be set to error and transport error logs to Console:
$ npm run start-production
You can set port in ./config/production.json:
{
"port": 3002,
"log-mode": "production"
}
$ curl -X POST -H "Content-Type: text/plain" --data "this is raw data" http://127.0.0.1:3002/api/utf8towin1251
HTTP/1.1 200 OK
Content-Type: text/plain; charset=win-1251
body: raw text