var express = require('express'); var router = express.Router();

var colors = ['red', 'yellow', 'green', 'blue'];

var currentColorIndex = 0;

router.get('/color.html', function(req, res) { var currentColor = colors[currentColorIndex]; var html = '' + currentColor + '

' + currentColor + '

'; res.send(html);

currentColorIndex++; if(currentColorIndex >= colors.length) { currentColorIndex = 0; } });

module.exports = router;


原文地址: https://www.cveoy.top/t/topic/mrfs 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录