https://github.com/gozeon/ss
simple server with koa
https://github.com/gozeon/ss
esm koa lightweight nodejs server tiny
Last synced: 8 months ago
JSON representation
simple server with koa
- Host: GitHub
- URL: https://github.com/gozeon/ss
- Owner: gozeon
- License: mit
- Archived: true
- Created: 2020-10-16T08:10:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-03T07:22:04.000Z (over 1 year ago)
- Last Synced: 2025-03-21T21:29:18.285Z (about 1 year ago)
- Topics: esm, koa, lightweight, nodejs, server, tiny
- Language: JavaScript
- Homepage:
- Size: 169 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 为了更好的避免一些模块问题,不推荐使用这个命令行了,使用更好理解的目录管理方式,参考:https://github.com/gozeon/code-collections/tree/master/ss-next
# ss
Simple Server
**IMPORTANT:** `v2` is ESM, if you use commonjs, see `v1`

# install
```bash
npm install ss -g
```
# get starter
```bash
mkdir demo && cd demo
touch time.js
```
time.js
```js
export default (ctx) => {
ctx.body = new Date()
}
```
run server
```bash
ss
```
test
```
curl -I http://0.0.0.0:3000/time
```
### ignore
new file `.ssignore`, same as `.gitignore`
### port & host
use `--port` , `--host` or `PORT=3000 HOST=0.0.0.0 ss`
### method
`$POSTname.js` -> `post 'name'`
### params
`_id.js` -> `../:id`
# referece
https://prettier.io/