Skip to content

Marius-brt/oneside-js

Repository files navigation

Logo

OneSide


npm npm npm bundle size AppVeyor

Documentation on the Github

OneSide is a web server that allows you to create pre-compiled dynamic website with NodeJs. With OneSide, you create the backend and the frontend of your application in a single project. OneSide uses EJS for pre-rendered pages.

OneSide Cli repo.

Features

  • 📨 Fast thanks to pre-compiled and cached pages
  • ⚙️ Pre-rendered page with EJS
  • 👍 Easy to use
  • 🔁 Live server
  • ✨ Coded in TypeScript

Quick start

Start by installing OneSide Cli on your computer. This package allows you to create a OneSide project easily and to create your website with the live server. This allows you to automatically refresh and restart your server when you modify it.

$ npm i --global oneside-cli

Now create a new project. To start, open the folder where you want to create your project with your cmd (a new folder will be created in it). Then enter the following command to create your project.

$ oneside init my-project

Then enter in your project folder and start the server using OneSide cli.

$ cd my-project
$ oneside start

And that's it! You are ready to code!

cli

Usage

Example of a basic OneSide server.

const oneside = require('oneside');
const app = oneside.init({
  port: 5050,
});

app.get('/', (req, res) => {
  res
    .ejs({
      message: 'Hello world !',
    })
    .render('home');
});

app.listen();

If you like the project please start it on Github ⭐. If you have an idea to improve OneSide or you find a bug please open an issue here.