Browse Source

[feature] Display magnet link if it doesn't redirect

pull/2/head
Muthu Kumar 6 years ago
parent
commit
637450db1a
  1. 18
      routes/index.js

18
routes/index.js

@ -7,9 +7,21 @@ const magnet = require('./magnet');
template = (magnet, meta) => (` template = (magnet, meta) => (`
<!DOCTYPE HTML> <!DOCTYPE HTML>
<meta charset="UTF-8"> <html>
<title>${meta.title}</title> <head>
<meta http-equiv="refresh" content="1; url=${magnet}"> <meta charset="UTF-8">
<title>${meta.title}</title>
<meta http-equiv="refresh" content="0; url=${magnet}">
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<h1> :magnet:</h1>
<pre>
${magnet}
</pre>
</p>
</body>
</html>
`) `)
router.get('/:shortlink', (req, res, next) => { router.get('/:shortlink', (req, res, next) => {

Loading…
Cancel
Save