From a3fed857baf21dff814e1bf76b3bae1b11819cd9 Mon Sep 17 00:00:00 2001 From: wally <18603454788@163.com> Date: Tue, 27 Jul 2021 13:59:14 +0800 Subject: [PATCH] feat: svrx mock --- .svrxrc.js | 16 ++++++++++++++++ package.json | 16 ++++++++++++++++ route.js | 7 +++++++ 3 files changed, 39 insertions(+) create mode 100644 .svrxrc.js create mode 100644 package.json create mode 100644 route.js diff --git a/.svrxrc.js b/.svrxrc.js new file mode 100644 index 0000000..44bfc4b --- /dev/null +++ b/.svrxrc.js @@ -0,0 +1,16 @@ +module.exports = { + port: 3000, + https: false, + // registry: 'https://registry.npm.taobao.org', + plugins: [ + { + name: 'qrcode', + options: { + ui: true + } + }, + // 'weinre', + 'mock', + + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c862448 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "plugin-templete", + "version": "1.0.0", + "description": "", + "main": ".svrxrc.js", + "scripts": { + "dev": "svrx --mock --route route.js" + }, + "repository": { + "type": "git", + "url": "gitea@dd.tall.wiki:wally/plugin-templete.git" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/route.js b/route.js new file mode 100644 index 0000000..ccf7171 --- /dev/null +++ b/route.js @@ -0,0 +1,7 @@ +get('/blog').to.json({ + code: 200, + msg: 'ok', + data: { + title: 'Hello world' + } +})