Skip to content
/ Rayso-API Public template

Provides ray.so as a REST API version. Make beautiful and prettified code screenshots by just sending a POST or GET request.

License

Notifications You must be signed in to change notification settings

akashrchandran/Rayso-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rayso-API

forthebadge

Provides ray.so as a REST API version. Make beautiful and prettified code screenshots by just sending a POST or GET request.

https://rayso-c3754cd07bd3.herokuapp.com/api

Parameters

Parameter Default value Type Description
code None (required) String The code which is used to make the screenshot.
title "Untitled-1" String The title will be displayed on top of the code box.
theme "breeze" String There are several options of how your box will look like. Available themes: vercel, supabase, tailwind, bitmap, noir, ice, sand, forest, mono, breeze, candy, crimson, falcon, meadow, midnight, raindrop, sunset
background true Boolean If disabled, it will create an image of code box only, without background.
darkMode true Boolean If disabled, it will change your theme to its light version.
padding 32 String or Number Distance between borders and code box. Available values: 16, 32, 64 and 128.
language "auto" String You better leave it auto :/ However, you can try to pass some language name and if it worked, good for you!

Using GET Request /

It uses query parameters.

http://localhost:3000/api?code=console.log(%22Hello%20World%22)%3B&language=javascript&title=Test

Using POST Request /

Body is JSON with these params:

{
  "code": "console.log('Hello World');",
  "language": "javascript",
  "title": "Test"
}

Example output

api

Deployment

Deployment

To deploy the Rayso-API on Heroku, you can use the Heroku Button. Just click the button below and follow the instructions:

Deploy

Once the deployment is complete, you will have your own instance of the Rayso-API running on Heroku.

Local Development

To run the Rayso-API locally, you can follow these steps:

  1. Clone the repository:
git clone https://github.com/akashrchandran/rayso-api
cd rayso-api
  1. Install the dependencies:
npm install
  1. Start the development server:
npm start

Credits

s0ftik3 -> For creating rayso-api package but now it is not maintained so I have forked his and upated rayso.

Me -> For nothing.

About

Provides ray.so as a REST API version. Make beautiful and prettified code screenshots by just sending a POST or GET request.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published