Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

samsun

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

samsun

Fast Backend server framework (Under Beta 📦)

  • 0.1.0-beta.6
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

samsun 🌃

NPM Version NPM Downloads NPM License

Samsun is a free and open source Backend server framework for complex, scalable or basic functional servers for applications.

Samsun contains many features that will shorten the development time for your server. Like:

  • File based route
  • Error handlers
  • No config needed
  • Extensible with plugins
  • Hot refresh
  • And more...

Getting Started

You can start your project by downloading Samsun and Samsu.

npm install samsum samsu

What you need to do next is to create files and define defult exported functions for them.

The value returned by the function will be sent automatically.

index.js:

export default function (req, res) {
  return 'Hello from server!'
}

Development

To start a server with hot refresh and error messages, simply use the samsu command to start a test server.

samsu

If you want to change anything related to the server or many other things in the development section, you can create a config file.

samsun.config.js:

import { defineConfig } from 'samsun'

export default defineConfig({
  server: {
    port: 5555
  }
})

You can also use the samsu --config=(config) command to use different config files in different situations.

samsun.config.prod.js:

import { defineConfig } from 'samsun'

export default defineConfig({
  server: {
    port: 3000
  }
})
samsu --config=samsun.config.prod.js

Restful API

Samsun is great for building complex APIs. Instead of defining the route of many files one by one, just name them.

api/v1.js:

export default function (req, res) {
  return {
    status: 'ok'
  }
}

When you go to route /api/v1 a json like this will be returned:

{
  "status": "ok"
}

Plugins

You can change the output with the defineConfig function, or by specifying a plugin you downloaded from npm in the config file.

import { defineConfig } from 'samsun'
import myPlugin from 'samsun-plugin-myPlugin'

export default defineConfig({
  plugins: [myPlugin()]
})

We will explain this in more detail when we create a documentation site.

License

MIT

Keywords

FAQs

Package last updated on 04 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc