feat(api): add /sync-from-legacy route

This commit is contained in:
41666 2021-03-21 21:34:06 -04:00
parent a983492154
commit 28d573043d
15 changed files with 260 additions and 6 deletions

5
packages/backend-emulator/main.js Normal file → Executable file
View file

@ -1,3 +1,4 @@
#!/usr/bin/env node
const path = require('path');
require('dotenv').config({ path: path.resolve(__dirname, '../../.env') });
const vm = require('vm');
@ -11,7 +12,7 @@ const crypto = new Crypto();
const fetch = require('node-fetch');
const args = require('minimist')(process.argv.slice(2));
const basePath = args.basePath;
const basePath = args.basePath || process.cwd();
if (!basePath) {
throw new Error('--basePath is not set.');
}
@ -170,7 +171,7 @@ const rebuild = () =>
const watcher = chokidar.watch(path.resolve(__dirname, basePath), {
ignoreInitial: true,
ignore: '**/dist',
ignore: '**/{dist,node_modules}',
});
watcher.on('all', async (type, path) => {

View file

@ -1,6 +1,9 @@
{
"name": "@roleypoly/worker-emulator",
"version": "0.1.0",
"bin": {
"cfw-emulator": "./main.js"
},
"scripts": {
"build": "node main.js --build",
"start": "node main.js"