@imagineee/wing-js

1.0.1 • Public • Published

wings-js

Fast web framework for Node js

const wings = require("@imagineee/wing-js")
var app = new wings.server()

app.listen(3000, () => console.log("running on port 3000"))

app.use('files', '/public')

app.onGet("/", (ctx) => {
    ctx.res.send("hi")
})
app.onGet("/html", (ctx) => {
    ctx.res.sendFile('./public/index.html')
})

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm i @imagineee/wing-js

Features

  • Small:
  • Easy syntax
  • Fast to setup
  • More coming soon!

Philosophy

Wings is meant to be small, easy and fast out of the box with every thing provided.

Docs

To get started, import the module in your app after installation

const wings = require("@imagineee/wing-js")

API

  • new server() to make a new server add:
var app = new wings.server()
  • listen(port, callback) to start a server or listen on a port
    • port [integer]: the port to listen on
    • callback [function]: what to do when succeeded

example

app.listen(3000, () => console.log("running on port 3000"))
  • onGet('path', callback) to respond on a reqest on a path
    • path [string]: the path
    • callback [function]: what to do affter reciving a request

example

app.onGet("/", (ctx) => {
    ctx.res.send("hi")
})

Package Sidebar

Install

npm i @imagineee/wing-js

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.06 kB

Total Files

8

Last publish

Collaborators

  • imagineee