Edits history of script submission #9021 for ' HTTP route script with preprocessor template (windmill)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    
    export async function preprocessor(
    	event: {
    		kind: 'http' | 'email' | 'webhook',
    		http?: {
    			route: string // The route path, e.g. "/users/:id"
    			path: string // The actual path called, e.g. "/users/123"
    			method: string
    			params: Record<string, string>
    			query: Record<string, string>
    			headers: Record<string, string>
    		}
    	},
    	/* your other args */ 
    ) {
      console.log(event)
    	return {
    		// return the args to be passed to the flow
    	}
    }
    
    
    export async function main(
      /* main function args */
      a: string,
    ) {
      console.log('main')
      // Implement the main function logic here
    }
    

    Submitted by hugo697 356 days ago

  • bun
    
    export async function preprocessor(
    	event: {
    		kind: 'http' | 'email' | 'webhook',
    		http?: {
    			route: string // The route path, e.g. "/users/:id"
    			path: string // The actual path called, e.g. "/users/123"
    			method: string
    			params: Record<string, string>
    			query: Record<string, string>
    			headers: Record<string, string>
    		}
    	},
    	/* your other args */ 
    ) {
      console.log(event)
    	return {
    		// return the args to be passed to the flow
    	}
    }
    
    
    export async function main(
      /* main function args */
    ) {
      console.log('main')
      // Implement the main function logic here
    }
    

    Submitted by hugo697 356 days ago

  • bun
    
    export async function preprocessor(
    	wm_trigger: {
    		kind: 'http' | 'email' | 'webhook',
    		http?: {
    			route: string // The route path, e.g. "/users/:id"
    			path: string // The actual path called, e.g. "/users/123"
    			method: string
    			params: Record<string, string>
    			query: Record<string, string>
    			headers: Record<string, string>
    		}
    	},
    	/* your other args */ 
    ) {
      console.log(wm_trigger)
    	return {
    		// return the args to be passed to the flow
    	}
    }
    
    
    export async function main(
      /* main function args */
    ) {
      console.log('main')
      // Implement the main function logic here
    }
    

    Submitted by hugo697 356 days ago

  • bun
    
    export async function preprocessor(
    	wm_trigger: {
    		kind: 'http' | 'email' | 'webhook',
    		http?: {
    			route: string // The route path, e.g. "/users/:id"
    			path: string // The actual path called, e.g. "/users/123"
    			method: string
    			params: Record<string, string>
    			query: Record<string, string>
    			headers: Record<string, string>
    		}
    	},
    	/* your other args */ 
    ) {
    	return {
    		// return the args to be passed to the flow
    	}
    }
    
    
    export async function main(
      /* main function args */
    ) {
      // Implement the main function logic here
    }
    

    Submitted by hugo697 596 days ago