This repository contains the backend service for compiling code written in Rat-language. It is designed to work in conjunction with a front-end that provides an interface for writing and submitting Rat-language code to be compiled.
Before you begin, ensure you have the following installed:
- Node.js (version 12.x or later recommended)
- npm (comes with Node.js installation)
Follow these steps to get your backend service running:
Clone this repository to your local machine using git:
git clone https://github.com/<your-username>/output-backend.git
cd output-backendReplace with your GitHub username or organization name under which the repository resides.
Navigate to the cloned repository directory and run the following command to install all required dependencies:
npm install
This command reads the package.json file and installs all necessary packages listed under dependencies.
Once the dependencies are installed, you can start the server by running:
npm start
This will start the backend server typically on port 4000, listening for requests from the front-end service.
With the server running, it will accept POST requests at the /compile endpoint. This endpoint expects JSON data containing the Rat-language code to be compiled.
You can test the server using a tool like Postman or curl with a request like this:
curl -X POST http://localhost:4000/compile \
-H "Content-Type: application/json" \
-d '{"code": "print(\\"hello world!\\")", "outputType": "js"}'
Contributions to the backend are welcome! Please feel free to fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.