initial version of texcount

This commit is contained in:
Henrique Dias
2015-06-08 18:35:24 -03:00
parent f707ad0926
commit 25d73ab6f9
5 changed files with 86 additions and 1 deletions

View File

@@ -66,3 +66,13 @@ module.exports = CompileController =
res.send JSON.stringify {
code: codePositions
}
wordcount: (req, res, next = (error) ->) ->
file = req.query.file
project_id = req.params.project_id
CompileManager.wordcount project_id, file, (error, result) ->
return next(error) if error?
res.send JSON.stringify {
texcount: result
}