appweb是一个非常好的嵌入式web server,它使用C/C++来编写,能够运行在目前所有流行的操作系统上。
1.安装appweb
下载appweb3.3.1的安装包,解压,./install安装,安装完成后在浏览器中输入http://127.0.0.1:7777弹出appweb的官方网站就说明安装成功,安装完后系统将会增加以下目录:
/etc/appweb :存放对appweb进行配置的文件
/var/www/appweb-default :存放网页的地方
/var/log/appweb :2个文件,记录appweb的访问和错误信息
/usr/lib/appweb :头文件,库文件等等
以上目录都是appweb默认的,我们也可以通过appweb.conf来重新配置。
2.如何在appweb中使用EJS
进入/etc/appweb,执行:ajsweb generate app blog,信息如下:
[CREATED] Directory: blog
[CREATED] Directory: .tmp
[CREATED] Directory: .ejs
[CREATED] Directory: bin
[CREATED] Directory: config
[CREATED] Directory: controllers
[CREATED] Directory: db
[CREATED] Directory: db/migrations
[CREATED] Directory: doc
[CREATED] Directory: logs
[CREATED] Directory: models
[CREATED] Directory: messages
[CREATED] Directory: test
[CREATED] Directory: src
[CREATED] Directory: utils
[CREATED] Directory: views
[CREATED] Directory: views/layouts
[CREATED] Directory: web
[CREATED] Directory: web/default
[CREATED] Directory: web/images
[CREATED] Directory: web/themes
[CREATED] App: "src