Sha256: 1ed97de20f962e3ec623a6e305829b0b5bf860a0d125e980819fb8b90d30d256

Contents?: true

Size: 680 Bytes

Versions: 1

Compression:

Stored size: 680 Bytes

Contents

// requires
const express = require('express')
const path = require('path')
const fs = require('fs')

// express
const app = express()

// webpack
const wp = require('./webpack')
wp.serverConfig(app)

// requests
const queries = require("./queries")

// views
app.set('view engine', 'pug')
app.set("views", path.join(__dirname, "views"))


// routes
app.get('/', (req, res) => {
  queries.home( function(items){
    return res.render("index", { items: items })
  })
})

app.get('/:slug', (req, res) => {
  queries.show( req.params.slug, function(item){
    return res.render("show", { item: item })        
  })
})

// Init
app.listen(3000, () => console.log('Running on 3000!') )

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dx-0.1.0 lib/templates/pug/index.js