A url shorten web site in node.js
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
extensions/chrome
public
routes
sql
views
.gitignore
README.md
app.js
config.js
id.js
package.json
start.sh
storage.js
utils.js

README.md

Introduction

A url shorten web site powered by node.js and express.js. A online demo is at fnil.me.

Setup

First,i am using mysql(data storage) and redis(cache),so you have to configure mysql/redis in config.js:

 exports.config = {
    mysqlHost:"localhost",
    mysqlUser:"root",
    mysqlPassword:"",
    mysqlDB:"shorten",

    redisHost:'localhost',
    redisPort:6379,

    site:'http://localhost:3000',
    linkMinLength:10,
    linkBits:6
}

Including user,password,database,redis host/port etc.Create the table using sql/st_links.sql before startup:

 msyql> source st_links.sql;

Second,you must install node.js, then install node modules by:

 sudo npm install -d

At last,startup the http server:

 sh start.sh

The site is online http://localhost:3000.

Chrome extension

You can install the chrome extension at folder extensions/chrome, it will use fnil.me's API to short URL in current chrome tab address bar.