Skip to content

zvecr/rest-ahk

Repository files navigation

rest-ahk

Compile service for AutoHotkey scripts

Build Status Codacy Badge Dependabot Status

REST service for compiling AutoHotkey scripts .ahk to .exe

Behind the scenes, wine and xvfb are used to run Ahk2Exe, producing a lightweight Linux based container, deployable almost anywhere.

For the UI, see the zvecr/vue-ahk project.

Dependencies

  • nodejs (and npm)
  • wine
  • xvfb
  • Ahk2Exe (Installed to the wine path)

Examples

The following examples assume either node is running the project or the rest-ahk docker container is running locally.

POST /compile Example

Note: While this example uses Unix-like paths, the following will produce a Windows executable.

curl -X POST -H "Content-Type: text/plain" --output /tmp/test.exe --data '
^j::                    
Send, My First Script
return                  
' localhost:8080/compile

GET /status Example

To status endpoint can be used to view the current service status, including various compile stats.

curl http://localhost:8080/status

Which should produce a JSON object.

{"compile":{"queue":0,"cache":0}}

Development

For convenience a .nvmrc file has been provided at the root of the project directory.

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Compiles and runs for production

npm run start

Run your tests

npm run test

Lint files

npm run lint

Docker

A simple workflow to package (and run) the service for production.

docker build --rm -f "Dockerfile" -t rest-ahk:latest .

docker run --rm -it -p 1234:1234/tcp ahk-docker:latest

About

Compile service for AutoHotkey scripts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •