mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
merge
This commit is contained in:
commit
adea3320bc
4
app.js
4
app.js
@ -14,8 +14,7 @@ var app = express();
|
||||
app.set('views', path.join(__dirname, 'views'));
|
||||
app.set('view engine', 'jade');
|
||||
|
||||
// uncomment after placing your favicon in /public
|
||||
//app.use(favicon(__dirname + '/public/favicon.ico'));
|
||||
app.use(favicon(__dirname + '/public/favicon.ico'));
|
||||
app.use(logger('dev'));
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
@ -25,6 +24,7 @@ app.use(express.static(path.join(__dirname, 'public')));
|
||||
app.use('/', routes);
|
||||
app.use('/avatars', avatars);
|
||||
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use(function(req, res, next) {
|
||||
var err = new Error('Not Found');
|
||||
|
||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@ -9,6 +9,10 @@ var valid_uuid = /^[0-9a-f]{32}$/;
|
||||
router.get('/:uuid/:size?', function(req, res) {
|
||||
var uuid = req.param('uuid');
|
||||
var size = req.param('size') || 180;
|
||||
// Add temporary restriction to prevent app from crashing
|
||||
if (size <= 0) {
|
||||
size = 180;
|
||||
}
|
||||
console.log(uuid);
|
||||
if (valid_uuid.test(uuid)) {
|
||||
var filename = uuid + ".png";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user