Quick Start Guide
Launch your first XyPriss server in minutes using the CLI or manual setup.
Method 1: Using XyPriss CLI (Recommended)
The CLI provides the fastest way to initialize a production-ready project with all the necessary boilerplate.
Initialize the project
Run the following command to start the interactive project setup:
xfpm initVerification and Install
Navigate to your project directory. While xfpm init usually handles dependency installation, you can run this manually if the process was interrupted (network failure, crash, etc.):
cd my-app && xfpm installStart development
Launch the development server with hot-reload enabled:
xfpm devMethod 2: Manual Setup
If you prefer to build from scratch, you can install the `xypriss` package manually.
xfpm install xyprissCreate a Basic Server
Create an `index.ts` file and add the following code to initialize a secure server:
import { createServer } from "xypriss";
const app = createServer({
server: { port: 3000 },
security: { enabled: true },
});
app.get("/", (req, res) => {
res.success("Hello from XyPriss Stable");
});
app.start();Advanced Features
Typed Routing
Native support for typed path parameters and API versioning.
app.version("v1", (v1) => {
v1.get("/user/:id<number>", (req, res) => {
res.success(`User ${req.params.id}`);
});
});Multi-Server
Run multiple isolated server instances from a single process.
const app = createServer({
multiServer: {
enabled: true,
servers: [
{ id: "api", port: 3001 },
{ id: "admin", port: 3002 }
]
}
});Running your app
Always use xfpm run to execute your scripts and entry points.
xfpm devLearn how the native Go-core handles routing, security, and performance at the lowest level.
