Setup Working Environment for Developing Cloudflare Workers Apps

I know most of us just want to dive into development when we see new tool or framework. But then there is so many comebacks for things that we need to do at the beginning. In this post I will describe my working environment for development of Workers.

IDE (Integrated Development Environment)

I usually use Visual Studio Code. It has great extension library but you don’t need anything special for now. You can download it here.

Cloudflare Wrangler

Wrangler is a CLI tool designed for development of workers. Here is its homepage. And you can find GitHub page here.

Quick Installation of Wrangler

npm i @cloudflare/wrangler -g

That is for installation but you need to configure your environment for publishing. The configuration file is created in a .wrangler directory in your computer's home directory. You need to add account email and global API Key to this file.

email = "email[at]"

You can get your API Key from CF Dashboard. Go to Dashboard>Profile>API Tokens and get ‘ Global API Key’.

Generate From Template

After these quick installations and configurations you can generate your first workers app. I recommend to use template for understand path structure and configurations.

wrangler generate

This command on terminal will create first basic workers app for you. It actually clones this GitHub repo. But it is enough for a start.

There are 3 main files in our folder now. index.js, wrangler.toml and package.json.

index.js is your main javascript file. CF will try to run this file first. You can change this file’s name or add more files to environment.
package.json is your main configuration file for workers app. You can add version, name of your app, depended packages or change main file name on this file.
wrangler.toml is configuration of environments and deployment. You can define type of your app, route configuration, zone info, KV info, etc. here.

All set

After these steps you are all set to start development of workers app. You may start with Playground if you like to start simple and don’t want to set up anything.

Originally published at on May 26, 2020.




We write, talk and discuss the cloud.

Recommended from Medium

APIs - Application Programming Interface, API Can Improve Your Business.

API Architecture, Application programming interface

Objective-C: How to create a dictionary?

Amazon Web Services (AWS) Cheat Sheet

Review: Tailwind CSS

Pros and Cons of In-House and Outsourcing Software Development

Python Logging: Colorize Your Arguments!

Variables in Java A variable is a name given to a memory location.

Unity — Create a fader in Timeline

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
İren Saltalı

İren Saltalı

MSc. Computer Engineer. Founder of @image4io, .NET Software Consultant @kloia_com, co-organizer in @serverlesstr, Community Builder of @awscloud.

More from Medium

Implementation of a Lambda function and creation of an SQS with Serverless

Top 6 reasons why you should try new STRAPI v4 in your next project

How to use custom domains? Shopify Hydrogen + Cloudflare Workers

Your CORS and API Gateway survival guide