Project Structure

An overview of the SherpaJS project structure.


Top-level Directories

Top-level directories are used to organize endpoints and static files.

routesEndpoint routes
publicStatic assets, optional only if you want to server public assets

Top-level Files

Top-level files are used to configure SherpaJS and manage the environment.

sherpa.server.tsSherpaJS server config
sherpa.module.tsSherpaJS module config, optional only if creating a module
.envEnvironment Varibles File

Routing Conventions

The naming conventions for inside the routes directory, allows you to define routes usings segments and different types of endpoints. View and functions endpoints may persist together, but no other files should be present in your routes directory.

index.ts .jsFunctions endpoint
module.ts .jsModule endpoint
view.htmlView endpoint
/folder_nameRegular route segment, any folder_name
/[param_name]Dynamic route segment, any param_name