body {
background: #24292e;
box-sizing: border-box;
padding: 20px 20px;
margin: 0px;
font-family: 'Poppins', sans-serif;
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: #1f252a;
}
::-webkit-scrollbar-thumb {
background: #404c58;
border-radius: 8px;
}
main {
display: flex;
flex-direction: column;
}
.code-box {
display: flex;
}
.box {
margin-top: -7px!important;
color: #b0b7be;
}
.code-lines {
padding: 0px;
margin: 0px;
width: 30px;
border: 0px;
outline: none;
font-size: 13px;
overflow: inherit;
}
/* Add media query here */
@media screen and (min-width: 1060px) {
main {
flex-direction: row;
}
}
<main>
<div class="code-box">
<div class="code-lines">1 <br>2 <br>3 <br>4 <br>5 <br>6 <br>7 <br>8 <br>9 <br>10 <br>11 <br>12 <br>13 <br>14 <br>15 <br>16 <br>17 <br>18 <br>19 <br>20 <br></div>
<pre class="box hljs"><code id="submitCode">app.get(['/c/:documentIdOne/:documentIdTwo', '/compare/:documentIdOne/:documentIdTwo'], (req, res) => {
const documentOne = req.params.documentIdOne;
const documentTwo = req.params.documentIdTwo;
try {
fs.readFile(`./pastes/${documentOne}.txt`, 'utf-8', (err, documentOne) => {
if (err) return res.render('error.ejs', { error: 'One or more posts are not found!' });
fs.readFile(`./pastes/${documentTwo}.txt`, 'utf-8', (err, documentTwo) => {
if (err) return res.render('error.ejs', { error: 'One or more posts are not found!' });
if (documentTwo && documentOne) {
console.log(documentTwo);
console.log(documentOne);
res.render('compare.ejs', { documentOne: documentOne, documentTwo: documentTwo })
}
})
})
} catch (err) {
console.log(err);
res.render('error.ejs', { error: 'An error occured!' });
}
})</code></pre>
</div>
<div class="code-box">
<div class="code-lines">1 <br>2 <br>3 <br>4 <br>5 <br>6 <br>7 <br>8 <br>9 <br>10 <br>11 <br>12 <br>13 <br>14 <br>15 <br>16 <br>17 <br>18 <br>19 <br>20 <br></div>
<pre class="box hljs"><code id="submitCode">app.get(['/c/:documentIdOne/:documentIdTwo', '/compare/:documentIdOne/:documentIdTwo'], (req, res) => {
const documentOne = req.params.documentIdOne;
const documentTwo = req.params.documentIdTwo;
try {
fs.readFile(`./pastes/${documentOne}.txt`, 'utf-8', (err, documentOne) => {
if (err) return res.render('error.ejs', { error: 'One or more posts are not found!' });
fs.readFile(`./pastes/${documentTwo}.txt`, 'utf-8', (err, documentTwo) => {
if (err) return res.render('error.ejs', { error: 'One or more posts are not found!' });
if (documentTwo && documentOne) {
console.log(documentTwo);
console.log(documentOne);
res.render('compare.ejs', { documentOne: documentOne, documentTwo: documentTwo })
}
})
})
} catch (err) {
console.log(err);
res.render('error.ejs', { error: 'An error occured!' });
}
})</code></pre>
</div>
</main>