Skip to content

nibazshab/webnote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webnote

不想写说明了 :(

这是一个记事本,也是一个粘贴箱

说明

理论上应该支持全平台,测试过 Windows/Mac/Linux/FreeBSD 都能正常编译运行

自启动

[Unit]
Description=webnote service
[Service]
Environment=PORT=10003 DATA_DIR=/usr/local/webnote
ExecStart=/usr/local/webnote/webnote
Restart=on-failure
[Install]
WantedBy=multi-user.target

编译流程

  1. 检查代码
cargo check
cargo test
cargo fmt --all -- --check
cargo clippy -- -D warnings
  1. 编译文件
cargo build --verbose --release

API

  • /{id} GET/POST
  • / GET/POST
  • /-/{id} GET
# POST
curl -d t="text" 127.0.0.1:8080/test
curl -d "text" 127.0.0.1:8080
cat /etc/hosts | curl --data-binary @- 127.0.0.1:8080/test
cat /etc/hosts | curl -F f=@- 127.0.0.1:8080
  • /b/ GET/POST
  • /b/{id} GET/DELETE
# POST
curl -F [email protected] 127.0.0.1:8080/b/
# DELETE
curl -X DELETE 127.0.0.1:8080/b/test -H 'token: 2A9B3F692B1715A6'

参考

  • pereorga/minimalist-web-notepad

题外话

本质上这只是一个练手项目,用来学习用的

发展经过 php/mysql -> go/file -> go/sqlite -> rust/sqlite

About

网页记事本

Resources

License

Stars

Watchers

Forks