Getting Started
Set up connection & start server
Install Slack app

Click 'Add to Slack' button

install the Restsocket Slack app in Slack.

Register, log In & connect
Use Restsocket in the Slack chat window as follows: after registering, logging in, and connecting. Once you register, you can log in and start using it.

As shown above, you can register users, set up the DB connection, and test the REST API through the Restsocket Slack app chat. (The email, Bearer token, and connection information above are fictional. You must use information appropriate for the user for it to work.)
After configuring the connection, you can directly call the REST API at the designated endpoint using the Bearer token.
Register
/register [email]
Login
Get the Bearer token from your registered email
/login [email] [Bearer token]
The Bearer token will be sent to the registered email. Log in using the token that starts with 'Bearer.' This token consists of the word 'Bearer' followed by a space and 43 random characters.
Connect & Start your server
Connect to the database (Start REST API server).
/connect [Host] [Port] [DB user] [DB password] [Database name]
When you run /connect, the Restsocket server will connect to the database, and the server will start immediately.Example
After installing the app, you can execute the following steps in the Restsocket chat window.
/register abc@email.com
/login abc@email.com Bearer HeQYBbcAOMGfc4cQomxHFlKhjJO94jWHeQYOfo70gqL
/connect 111.222.123.121 3306 admin pass1234!! mydatabase
(The email, Bearer token, and connection information above are fictional. Please use the user's information.)
Test
After connecting to the database, you can immediately use the REST API.
You can check the list of tables by using the /tables command.
/tables
{"code":200,"data":["address","users","table1"]}
Use it in JavaScript as follows.
fetch('https://r-sock.com/api/fetch/users', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_token',
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: 3 })
})
.then(response => response.json()
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
By default, you can easily configure REST API calls using the table name and column names.
Last updated