{"size": 642, "ext": "js", "max_stars_repo_path": "src/app.js", "max_stars_repo_name": "backupbrain/expressjs-federated-crypto-address-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/app.js", "max_issues_repo_name": "backupbrain/expressjs-federated-crypto-address-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/app.js", "max_forks_repo_name": "backupbrain/expressjs-federated-crypto-address-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.7096774194, "max_line_length": 72, "alphanum_fraction": 0.6510903427}
const express = require('express')
const addressRoutes = require('./routes/addresses.js')
require('./config/credentials.js')
const bodyParser = require('body-parser')
const cors = require('cors')

const app = express()
app.use(bodyParser.json())
app.use(cors())
app.set('view engine', 'pug')
app.set('views', './views')

const port = 3000

/**
 * Routes
 */
app.get('/', function (req, res) {
  res.render('index')
})

app.use('/api/1.0/addresses', addressRoutes)

app.use((req, res) => {
  res.status(404).json({ status: 'error', error: 'Resource not found' })
})

app.listen(port, () => {
  console.log(`Server running at port ${port}`)
})
