bablic
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Bablic-Node-SDK

To install simply use NPM:

$ npm install --save bablic

Config your app:

Javascript:

const {create} = require("bablic");
app.use(create({
   siteId: '[your site id]',
   rootUrl: 'http://[root url of your site]',
   subDir: true, // if you want to use sub dir for languages like /es/ /fr/
   }));
   
app.get('/',function(req,res) { 
   console.log('the current language for the user is',req.bablic.locale);
   res.render('index.ejs',{});
});

Typescript:

import {create} from "bablic";
app.use(create({
   siteId: '[your site id]',
   rootUrl: 'http://[root url of your site]',
   subDir: true, // if you want to use sub dir for languages like /es/ /fr/
   }));

In your layout template file you can add the snippet:


<html>
   <head>
      <%- bablic.snippetTop %>
   </head>
   <body>
      <%- body %>
    </body>
</html>

And use!

Package Sidebar

Install

npm i bablic

Weekly Downloads

40

Version

1.1.1

License

GPL v2

Unpacked Size

113 kB

Total Files

21

Last publish

Collaborators

  • ishaibablic
  • talbablic