https://github.com/mvr-studio/mize
Next.js API routes - without Next.js
https://github.com/mvr-studio/mize
api fakelambda fakeserverless lambda micro routes-api serverless
Last synced: 9 months ago
JSON representation
Next.js API routes - without Next.js
- Host: GitHub
- URL: https://github.com/mvr-studio/mize
- Owner: mvr-studio
- Created: 2023-01-18T21:59:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-22T12:14:07.000Z (about 3 years ago)
- Last Synced: 2025-06-14T09:01:53.101Z (10 months ago)
- Topics: api, fakelambda, fakeserverless, lambda, micro, routes-api, serverless
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mize: Lambda-esque functions
This tiny server allows you to create function handlers that will act like Next.js API routes - without Next.js.
Routing is file system based, so all you have to do is to create a new file for a route in `/src/api`.
## Installation
```sh
$ npx create-mize-app app-name
```
or
```sh
$ yarn create mize-app app-name
```
## Usage
Development server:
```sh
$ yarn dev
```
Build dist version:
```sh
$ yarn build
```
Start dist version server:
```sh
$ yarn start
```
## Features
### Routing
Routing is file system based. Thanks to [jesseditson/fs-router](https://github.com/jesseditson/fs-router#usage).
### Security
Secure your API easily by setting the `MIZE_API_KEY` environmental variable.
Then send your requests with `Authorization` header like: `Mize [MIZE_API_KEY]`.
## Example
Please referr to [apps/example-app](https://github.com/mvr-studio/mize/tree/main/apps/example-app)
## Deployment
### Dockerfile
Run locally:
```sh
$ docker build -t mize .
$ docker run -p 3000:3000 mize
```
### Heroku and Herokuish
The repo contains `Procfile`, so you're good to deploy it to Heroku.