MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

update server.cjs

+14 -13
+11
tests/server/html.cjs
··· 1 + Ant.exports.html = (strings, ...values) => { 2 + let result = ''; 3 + for (let i = 0; i < strings.length; i++) { 4 + result = result + strings[i]; 5 + if (i < values.length) { 6 + let escaped = values[i]; 7 + result = result + escaped; 8 + } 9 + } 10 + return result; 11 + };
+3 -13
tests/server/server.cjs
··· 1 1 const Radix3 = Ant.require('./radix3.cjs'); 2 - const router = new Radix3(); 2 + const { html } = Ant.require('./html.cjs'); 3 3 4 - function html(strings, ...values) { 5 - let result = ''; 6 - for (let i = 0; i < strings.length; i++) { 7 - result = result + strings[i]; 8 - if (i < values.length) { 9 - let escaped = values[i]; 10 - result = result + escaped; 11 - } 12 - } 13 - return result; 14 - } 4 + const router = new Radix3(); 15 5 16 6 router.insert('/', c => { 17 7 return c.res.body(`Welcome to Ant HTTP Server with Radix3 Router! ··· 64 54 65 55 if (result?.handler) { 66 56 const ctx = { req, res, params: result.params }; 67 - return result.handler(ctx); 57 + return void result.handler(ctx); 68 58 } 69 59 70 60 return res.body('not found: ' + req.uri, 404);