Application directory - servaland/serva GitHub Wiki

The application directory is where your code lives. Serva will read this directory and construct your application from its contents. Using a specific layout Serva helps keep your project organized and maintainable.

Directory structure

Serva is still very early in development and directories may be added in the future. Here is the list of folders that is currently in the roadmap.

Name Description Available
./config Runtime configurations :x:
./public Serve static files :x:
./routes Routes and hooks :heavy_check_mark:
./services Application services :x:

Renaming directories

:building_construction: Feature planned

You can rename any folder if it conflicts with an existing project layout. Define your custom layout in the dirs property of serva.config.json.

{
  "dirs": {
    "routes": "./src/api"
  }
}

We recommend not changing the structure for new projects. It's an easier and greater experience for developers not to search inside of files to see where code lives. Code should be noticeable much like you would store documents and pictures on your personal machine.