Just put the method and path in a string mapped to a function in the routes constant and you can have any function run when that path is fetched.
The provided file has some example functions imported from another file.
events{} | |
http { | |
# serve synbiohub on port 7777 | |
server { | |
listen 7777; | |
server_name localhost; | |
location / { | |
# Proxy to the new target URL without verifying SSL |
import cv2 | |
import numpy as np | |
def save_components(image_path): | |
# Load the image with alpha channel | |
img = cv2.imread(image_path, cv2.IMREAD_UNCHANGED) | |
# Create a binary image where 0 indicates transparent pixels | |
_, alpha_bin = cv2.threshold(img[:,:,3], 0, 255, cv2.THRESH_BINARY) |
setenforce 0 |
version : '3' | |
services: | |
ha: | |
image: haproxy | |
ports: | |
- "8080:8080" | |
- "8081:8081" | |
volumes: | |
- ./haproxy:/usr/local/etc/haproxy |
const async = require('async') | |
,fs = require('fs') | |
,http = require('http') | |
,ws = require('websocket') | |
; | |
const APPID = process.env.APPID; | |
let connections = []; | |
const WebSocketServer = ws.server |
import signal | |
import sys | |
import time | |
def signal_handler(signal, frame): | |
print("Wasting your time...") | |
time.sleep(3) | |
print("Goodbye") | |
raise SystemExit | |
signal.signal(signal.SIGINT, signal_handler) |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.11; | |
contract SVG1 { | |
string[] public svg; | |
} | |
contract User is SVG1 { | |
SVG1 s; | |
constructor (address _provider) { |
#!/usr/bin/env bash | |
FILE=BattleBlockTheater | |
MD5_PRE=436e91811d8a38de1918991969347b3d | |
MD5_POST=71eb6519233b21d85c858b39f2b4871f | |
OFFSET=0x24f2b9 | |
PAYLOAD='\x90\x90' | |
function getMD5() | |
{ |