author : alohaxuuuu
blog : http://alohaxuuuu.fun/
This is a simple project from local img to http img.
I hope this project inspires you.
IDEA: Upload to the server local database stored ,through HTTP: domain/XXX/XXX to access this image.
Using express`SSR for end-to-end , mustache-express render browser serve .
Frame : Express
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
download my project:
Install dependencies:
$ npm install
make sure your local database serve is opening and created database. database file in my project .
Importing a database.
Start the server:
$ node app.js
View the website at: http://localhost:3000
If not running, make sure the middleware is installed.
Using middleware:
"multer" "mustache-express" "mysql"
If you need to upload to the server to run, be aware that Windows and Linux write file paths differently
Thought it would help you give me a star⭐⭐⭐⭐⭐⭐⭐
这是一个使用express框架写的一个小型图床,由于不想使用网上的图床,因为都是需要钱或者只有免费保存几天,所以想自己写一个图床用于http化图片。
下载完项目后
安装依赖
$ npm install
保证你的本地数据库服务开启并且导入我准备好的数据库
Importing a database.
服务跑起来
$ node app.js
View the website at: http://localhost:3000
如果服务还没能跑起来就看一下是不是依赖没安装全
使用到的中间件:
"multer" "mustache-express" "mysql"
如果需要上传到服务器跑起来 那么需要注意Window与Linux对文件路径写法的不同
觉得不错可以给我一个星星⭐⭐⭐⭐⭐⭐⭐