Restapify
Mock REST API powered by Restapify, perfect for testing and development.
Restapify
rudemex/railway-restapify-template
Just deployed
š Restapify Template
Easily deploy a Restapify mock API to Railway ā perfect for testing and frontend development when your backend isn't ready yet.
āļø Getting Started
š§ Local Development
- Install dependencies:
npm install
yarn install
- Start the mock server:
npm run start
yarn start
- Open your browser:
- API base URL:
http://localhost:6767/api/
- Dashboard:
http://localhost:6767/restapify
The dashboard provides a UI to explore and test your mock endpoints.
š¦ Environment Variables
You can configure the mock server behavior using environment variables via a .env
file:
Variable | Default | Description |
---|---|---|
PORT | 6767 | Port where the server runs locally |
PUBLIC_PATH | api/ | Base path for all mock routes |
PUBLIC_URL | http://localhost:6767 | Full URL used in logs and dashboard links |
OPEN_DASHBOARD_PATH | true (only if local) | Open dashboard in browser when server starts (local only) |
Example .env
file:
PORT=6767
PUBLIC_PATH=api/
PUBLIC_URL=http://localhost:6767
OPEN_DASHBOARD_PATH=true
In Railway,
PUBLIC_URL
is set automatically viaRAILWAY_PUBLIC_DOMAIN
in most setups.
š Example Routes Served
This template includes the following mocked endpoints:
GET /api/me
GET /api/posts
GET /api/users
GET /api/users/[userid]
POST /api/users/[userid]
DELETE /api/users/[userid]
GET /api/users/[userid]/comments
You can modify or extend these by editing the files in the api/
directory.
š Deploy to Railway
Once deployed:
- API:
https://your-subdomain.up.railway.app/api/
- Dashboard:
https://your-subdomain.up.railway.app/restapify
š Documentation
Template Content
Restapify
rudemex/railway-restapify-template