Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
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:
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!'
}
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
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"
}
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.
FAQs
Fast Backend server framework (Under Beta 📦)
The npm package samsun receives a total of 0 weekly downloads. As such, samsun popularity was classified as not popular.
We found that samsun demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.