pelias / api

HTTP API for Pelias Geocoder
http://pelias.io
MIT License
220 stars 163 forks source link

Added Missing HTML / BODY tag #1598

Closed Dhananjay-JSR closed 2 years ago

Dhananjay-JSR commented 2 years ago

:wave: I did some awesome work for the Pelias project and would love for everyone to have a look at it and provide feedback.


Here's the reason for this change :rocket:


Here's what actually got changed

Added HTML and BODY tag in file changes


missinglink commented 2 years ago

hey, thanks for looking into this, a couple minor changes I'd like to see before merging:

const text = `
# Pelias API
### Version: [${peliasConfig.version}](https://github.com/pelias/api/releases)
${fs.readFileSync( markdownFile, 'utf8'}`

const html = `
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Pelias Geocoder</title>
  <style>html { font-family:monospace; }</style>
</head>
<body>
  ${markdown.toHTML(text)}
</body>
</html>`
missinglink commented 2 years ago

can you also please remove the content negotiation code, we don't need that and AFAIK it doesn't even work 🤷‍♂️

the controller can be simplified to:

function controller(req, res) {
  res.send(html);
}
Dhananjay-JSR commented 2 years ago

Made the changes as stated can you please check the PR once again

missinglink commented 2 years ago

I've pulled your commits into https://github.com/pelias/api/pull/1599 and merged, you may now close this PR/branch.

Thank you 🙇