• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sawicky/Mastodon

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

sawicky/Mastodon

开源软件地址(OpenSource Url):

https://github.com/sawicky/Mastodon

开源编程语言(OpenSource Language):

JavaScript 63.0%

开源软件介绍(OpenSource Introduction):

MASTODON

Express file structure:

app.js: runs the server, main core file for the application Models: holds model(db) files Public: css, javascript and images Routes: renders the HTML pages requested by the user View: html files, handlebars template engine (just html but can embed variables)

How it works:

“app.js” runs the server on port 3000, then it looks at the url requested and finds the route to display the HTML file.

Run the server

  1. install node then run npm install to install all the node modules requried

  2. You need to install mongodb Once installed, all you need to do is create a database on your machine: (for Mac)

    1. Enter mongo in terminal
    2. Enter use mastodon (to create db)
    3. Enter show dbs (make sure it is listed)
  3. npm start to start the server in "localhost:3000"

What to do:

When you create a new handlebars (html) file you need to do the following: For example lets create an about page.

  1. In view, create about.handlebars

  2. In app.js:

    var about = require(‘./routes/about’);
    app.use(‘\about’, about) //when the home page is requested, call "about"
    
  3. In routes create about.js and: Pretty much the same as other pages except change render to ‘about’




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
nickr2000/mastodon: CSS mods for mastodon 2.5发布时间:2022-08-18
下一篇:
rose-pine/mastodon: Soho vibes for Mastodon发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap