Sha256: b53e31a69d5693ea3bc37b9b5c011c5de5e6ab11eb17de9c948e65a2ba7bd534

Contents?: true

Size: 701 Bytes

Versions: 1

Compression:

Stored size: 701 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)

// requĂȘtes
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('Example app listening on port 3000!') )

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dx-0.1.0 docs/index.js