The Diego Web Framework

The Diego Web Framework #

A minimal web framework for creating web applications with Java and Groovy.

This framework does not intend to be an all-encompassing web framework, but a distillation of specific features that are very common in developing web-based applications - a framework for the 90% use case, if you will.

The end result is a tool that facilitates rapid application development, that is easy to learn, and provides a familiar experience to developers familiar with NodeJS-based web frameworks like Express and Koa.

Getting Started #

  1. Download and extract the project starter from the releases repository.
  2. Extract the zip file to a directory and add the directory containing the main diego script to your system PATH
  3. Lastly, add this directory as a system variable named DIEGO_HOME
  4. Test the installation by running the diego command from a new terminal window. You should see output as follows:

 Usage: diego [command] where [command] is one of:

  new [project-name]    Create a new project
  run                   Launch the Diego project in the current directory
  dist                  Create a distribution for the project in the current directory
  version               Print the framework version
  docs                  See the project documentation
  help                  Show this menu
  

Your first application #

Use the Diego CLI to create your first application:

diego new my-application

It will ask for a package name. Enter com.example and press Enter.

A new directory named named my-application should have been created. Test that everything works by running:

cd my-application
diego run

The server should start and you would be able to access the running application at http://localhost:8080

Super Dev Mode âš¡

In development, the application runs in Super Dev mode, meaning: source files are watched for changes and the application is rebuilt and reloaded when a change is detected. Just hit refresh! Any errors during re-compilation will be displayed in the console.

Follow along to the next sections to learn more about developing applications with Diego.

Next: Routing