This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate generated app to be usable without Babel and Node 5 directly
- Loading branch information
Showing
26 changed files
with
143 additions
and
113 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import path from 'path'; | ||
import notFound from './not-found-handler'; | ||
import { handler as error } from 'feathers-errors'; | ||
import logger from './logger'; | ||
'use strict'; | ||
|
||
export default function() { | ||
const errors = require('feathers-errors'); | ||
const notFound = require('./not-found-handler'); | ||
const logger = require('./logger'); | ||
|
||
module.exports = function() { | ||
const app = this; | ||
|
||
// Add your custom middleware here. Remember, that | ||
// just like Express the order matters, so error | ||
// handling middleware should go last. | ||
app.use(notFound()) | ||
.use(logger(app)) | ||
.use(error()); | ||
} | ||
.use(errors.handler()); | ||
}; |
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
'use strict'; | ||
|
||
// Add any common hooks you want to share across services in here. | ||
// | ||
// Below is an example of how a hook is written and exported. Please | ||
// see http://docs.feathersjs.com/hooks/readme.html for more details | ||
// on hooks. | ||
|
||
var myHook = function(options) { | ||
exports.myHook = function(options) { | ||
return function(hook) { | ||
console.log('My custom global hook ran. Feathers is awesome!'); | ||
}; | ||
}; | ||
|
||
export default { myHook }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
require('babel-core/register'); | ||
'use strict'; | ||
|
||
var app = require('./app').default; | ||
var port = app.get('port'); | ||
var server = app.listen(port); | ||
const app = require('./app'); | ||
const port = app.get('port'); | ||
const server = app.listen(port); | ||
|
||
server.on('listening', function() { | ||
console.log(`Feathers application started on ${app.get('host')}:${port}`); | ||
}); | ||
server.on('listening', () => | ||
console.log(`Feathers application started on ${app.get('host')}:${port}`) | ||
); |
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
9 changes: 5 additions & 4 deletions
9
generators/app/templates/static/src/middleware/not-found-handler.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import errors from 'feathers-errors'; | ||
'use strict'; | ||
|
||
export default function() { | ||
const errors = require('feathers-errors'); | ||
|
||
module.exports = function() { | ||
return function(req, res, next) { | ||
next(new errors.NotFound('Page not found')); | ||
}; | ||
} | ||
|
||
}; |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
'use strict'; | ||
|
||
// <%= name %>-model.js - A just a generic object literal model | ||
|
||
let <%= name %>Model = { | ||
const <%= name %>Model = { | ||
text: {type: String, required: true, index: true}, | ||
createdAt: {type: Date, 'default': Date.now}, | ||
updatedAt: {type: Date, 'default': Date.now} | ||
}; | ||
|
||
export default <%= name %>Model; | ||
module.exports = <%= name %>Model; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
'use strict'; | ||
|
||
// <%= name %>-model.js - A mongoose model | ||
// | ||
// See http://mongoosejs.com/docs/models.html | ||
// for more of what you can do here. | ||
|
||
import mongoose from 'mongoose'; | ||
const mongoose = require('mongoose'); | ||
const Schema = mongoose.Schema; | ||
|
||
let <%= name %>Schema = new Schema({ | ||
const <%= name %>Schema = new Schema({ | ||
text: {type: String, required: true, index: true}, | ||
createdAt: {type: Date, 'default': Date.now}, | ||
updatedAt: {type: Date, 'default': Date.now} | ||
}); | ||
|
||
let <%= name %>Model = mongoose.model('<%= name %>', <%= name %>Schema); | ||
const <%= name %>Model = mongoose.model('<%= name %>', <%= name %>Schema); | ||
|
||
export default <%= name %>Model; | ||
module.exports = <%= name %>Model; |
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
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
Oops, something went wrong.