How to deploy a code block to make automations
You can deploy a specific code block as frontend/backend or CRON function, depending on the parameters given on the code block. View the full documentation here: https://doc.notebookjs.app/#/jobs
How to deploy: Run the code block
Ctrl+Enter
and click on the cloud button ☁️ to publish the job online.
As first example: Try to deploy the HTML block below.
<h1>Hello world</h1>
npm i -S react@^18.2.0
npm i -S react-dom@^18.2.0
The block below is a React application, accessible after a login with the account given.
import React from 'react';
import ReactDOM from 'react-dom';
const LikeButton = (props) => {
return <h1>{props.name}</h1>;
}
ReactDOM.render(<LikeButton
name="Hello from React!" />
, htmlEl);
npm i -S tablify
The CRON job below will be executed every day at noon. Use Ctrl+Space
on the cron= parameter to help you change the period. Logs are accessible through the dashboard.
//exec: node
const tablify = require("tablify");
console.log(tablify({user:"tony", email: "tony@example.com"}))
npm i -S express
Once the API is deployed, the exposed port will always be publicly redirected to HTTP 443
//exec:node
const express = require('express')
const app = express()
app.get('/', function (req, res) {
console.log("pass")
res.send('Thank you 👍')
})
app.listen(4000)
You can use our recipe gallery: recipes (also accessible with Ctrl+N
> New from Template) to create ==beautiful dashboard reports==. We've also bundled useful ready to deploy blocks into an "Indie" pack for you, to create backends as well as sample integrations of popular third-party services:
👉 premium