Skip to content

Instantly share code, notes, and snippets.

@harada-shota
Created November 30, 2021 00:50
Show Gist options
  • Save harada-shota/a2b799cffc5793f71a0c57d10dcf565f to your computer and use it in GitHub Desktop.
Save harada-shota/a2b799cffc5793f71a0c57d10dcf565f to your computer and use it in GitHub Desktop.
import { setupWorker, rest } from "msw";
const worker = setupWorker(
rest.get("/login", (req, res, ctx) => {
const { username } = req.body
return res(
ctx.json({
username,
firstName: 'hoge'
})
);
})
);
worker.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment