Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marius-brt/oneside-js

OneSide is a pre-compiled dynamic website framework.
https://github.com/marius-brt/oneside-js

ejs http nodejs website

Last synced: 23 days ago
JSON representation

OneSide is a pre-compiled dynamic website framework.

Awesome Lists containing this project

README

        



Logo

OneSide




npm
npm
npm bundle size
AppVeyor


> Documentation on the [Github](https://github.com/Marius-brt/oneside-js/wiki)

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](https://github.com/Marius-brt/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.

```bash
$ 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.

```bash
$ oneside init my-project
```

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

```bash
$ cd my-project
$ oneside start
```

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

![cli](img/cli.png)

# Usage

Example of a basic OneSide server.

```js
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](https://github.com/Marius-brt/oneside-js) ⭐. If you have an idea to improve OneSide or you find a bug please open an issue [here](https://github.com/Marius-brt/oneside-js/issues).