mockit
  • mockit
  • Installation
  • Setup
  • Fixture
  • APIs
  • CLI
  • Advance
    • Typescript
    • Creating a custom server
    • Integrating with other tools
    • Using with webpack-dev-server
    • mockit.json
Powered by GitBook
On this page
  1. Advance

Creating a custom server

Instead of tying you down to mockit, you can also create your own server and use mockit's core functionalities.

Creating your own custom server

server.js
import express from 'express';
import mockit from '@builtwithluv/mockit';

const app = express();

mockit(app);

app.get('/my-own-endpoint', (req, res) => res.json({ hello: 'world' }));

app.listen(3000);

Creating your own custom endpoints will not be detected on mockit's client. However, your custom endpoints will be reachable.

PreviousTypescriptNextIntegrating with other tools

Last updated 6 years ago