Created
August 7, 2014 17:08
-
-
Save srph/8af96e0b70d443ab8693 to your computer and use it in GitHub Desktop.
apiv1.coffeescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = require '../app' | |
app.constant 'APIv1', -> | |
api = {} | |
# Base (alias) | |
base = '/api/v1' | |
# Base | |
api.base = base | |
# Auth | |
api.auth {} | |
api.auth.base = '#{base}/auth' | |
api.auth.check = '#{this.auth.base}/check' | |
api.auth.login = '#{this.auth.base}/login' | |
api.auth.logout = '#{this.auth.base}/logout' | |
# User | |
api.user = {} | |
api.user.base = '#{base}/users' | |
api.user.register = '#{this.user.base}/register' | |
api.user.connect = '#{this.user.base}/connection' | |
api.user.accept = '#{this.user.connect}/accept' | |
api.user.connection = (id) -> | |
return '#{this.user.base}/#{id}/connection' | |
api.user.connected = (id) -> | |
return '#{this.user.base}/#{id}/connected' | |
# Post | |
api.post = {} | |
api.post.base = '#{base}/post' | |
# Guilds | |
api.guild = {} | |
api.guild.base = '#{base}/post' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment