Skip to content
This repository was archived by the owner on Dec 5, 2022. It is now read-only.
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Missing example of tailor consuming a template storage. #337

@MateusAbdala

Description

@MateusAbdala

Hello, I'm trying to consume templates from a storage, but I'm only getting the response 'template not found'.

'use strict'

const http = require('http')
const Tailor = require('node-tailor')
const tailor = new Tailor({
  templatesPath: 'https://s3.example.com.br' + '/templates'
})

http
  .createServer((req, res) => {
    if (req.url === '/favicon.ico') {
      res.writeHead(200, { 'Content-Type': 'image/x-icon' })
      return res.end('')
    }

    req.headers['x-request-uri'] = req.url

    tailor.requestHandler(req, res)
  })
  .listen(8080, function() {
    console.log('Tailor server listening on port 8080')
  })

There is any example or documentation about this?

Local directory works:

const tailor = new Tailor({
  templatesPath: __dirname + '/templates'
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions