|
@@ -8,13 +8,24 @@ import syncSwapUsdcForEth from "./script/zksync2/sync/swapUsdcForEth.js"
|
|
import tiktokfiMint from "./script/zksync2/tiktokfi/mint.js";
|
|
import tiktokfiMint from "./script/zksync2/tiktokfi/mint.js";
|
|
|
|
|
|
const app = express();
|
|
const app = express();
|
|
|
|
+
|
|
app.use(bodyParser.json());
|
|
app.use(bodyParser.json());
|
|
|
|
+
|
|
|
|
+const endMiddleware = (req, res, next) => {
|
|
|
|
+ console.log(`request url: ${req.url}`);
|
|
|
|
+ console.log(`request params: ${JSON.stringify(req.body.params)}`);
|
|
|
|
+ console.log(`request address: ${JSON.stringify(req.body.wallet.address)}`);
|
|
|
|
+ next();
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+app.use(endMiddleware)
|
|
app.use("/zk-mute-swap-eth-usdc", muteSwapEthForUsdc)
|
|
app.use("/zk-mute-swap-eth-usdc", muteSwapEthForUsdc)
|
|
app.use("/zk-mute-swap-usdc-eth", muteSwapUsdcForEth)
|
|
app.use("/zk-mute-swap-usdc-eth", muteSwapUsdcForEth)
|
|
app.use("/zk-sync-swap-eth-usdc", syncSwapEthForUsdc)
|
|
app.use("/zk-sync-swap-eth-usdc", syncSwapEthForUsdc)
|
|
app.use("/zk-sync-swap-usdc-eth", syncSwapUsdcForEth)
|
|
app.use("/zk-sync-swap-usdc-eth", syncSwapUsdcForEth)
|
|
app.use("/zk-sync-tiktokfi-mint", tiktokfiMint)
|
|
app.use("/zk-sync-tiktokfi-mint", tiktokfiMint)
|
|
|
|
|
|
|
|
+
|
|
app.use((err, req, res, next) => {
|
|
app.use((err, req, res, next) => {
|
|
// 处理错误逻辑
|
|
// 处理错误逻辑
|
|
console.error(err); // 输出错误信息到控制台
|
|
console.error(err); // 输出错误信息到控制台
|