1.0.1 • Published 9 months ago

@nitra/tfm-node v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@nitra/tfm-node

usage with node

import tf from '@nitra/tfm'
// eslint-disable-next-line n/no-extraneous-import
import Fastify from 'fastify'

const fastify = Fastify()

const tr = {
  'Привіт Сонечко ': { en: 'Hello Sun ', lv: 'Sveika Saulīte ', ee: 'Tere Päike ' }
}

// Declare a route
fastify.post('/', {}, function (req, reply) {
  const t = tf.bind({ tr, lang: req.headers.lang })

  reply.send({ result: t`Привіт Сонечко ` })
})

// Run the server!
fastify.listen({ port: 3000 })
1.0.1

9 months ago

1.0.0

9 months ago