Axentax Compiler Server

A compilation API server for Axentax syntax using axentax-compiler.

sample url: https://validation-api.axentax.com/compiler?syntax=%40%40+%7B+Cm7+%7D

🚀Features

📦Installation

npm install

🏃‍♂️Startup

Development Mode

npm run dev

Production Mode (Single File Execution)

# Bundle and generate single dist/index.js
npm run bundle

# Start with single file (in dist directory)
node dist/index.js

# Or in one go
npm start

Starts on port 3000 by default. Can be changed with the PORT environment variable.

📡API Endpoints

POST /compiler / GET /compiler

Compiles Axentax syntax and verifies success/failure.

For GET requests, pass the encoded syntax in the syntax query parameter.

Request

{
  "syntax": "@@ { C D E }"
}

Response

Success (200 OK) — with ?conduct=true

{
  "message": "Compilation successful",
  "compiledData": { ... }
}

Success (204 No Content) — without query

No body

Error (400 Bad Request)

{
  "error": "Error message"
}

GET /health

Server health check

{
  "status": "OK",
  "message": "Axentax Compiler Server is running"
}

💡Usage Examples

cURL

# To receive 200 + JSON
curl -X POST 'http://localhost:3000/compiler?conduct=true' \
  -H 'Content-Type: application/json' \
  -d '{"syntax": "@@ { C D E }"}'

# For 204 (No Content) (no query)
curl -X POST 'http://localhost:3000/compiler' \
  -H 'Content-Type: application/json' \
  -d '{"syntax": "@@ { C D E }"}' -i

# Also available with GET (pass syntax as query)
curl 'http://localhost:3000/compiler?syntax=%40%40%20%7B%20C%20%7D&conduct=true'
curl -i 'http://localhost:3000/compiler?syntax=%40%40%20%7B%20C%20%7D'

JavaScript (fetch)

const response = await fetch('http://localhost:3000/compiler', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    syntax: '@@ { C D E }'
  })
});

const result = await response.json();
console.log(result);

🔧Technical Specifications

📝Axentax Syntax Examples

@@ {
  C D E F G A B
}

@@ 120 {
  C C C C
}

@@ D|A|D|G|A|D {
  2|2|2|0|0|0
}

For detailed syntax information, refer to the axentax-compiler documentation.

📄Links

Axentax Playground: https://axentax.github.io/axentax-playground/

📄License

This project is provided under the license described in the LICENSE file.