simonapiz / bossmachine Goto Github PK
View Code? Open in Web Editor NEWAn API to serve information to a Boss Machine app
An API to serve information to a Boss Machine app
As a bonus, you may implement routes to allow bosses to add and remove work from their minions' backlogs.
Schema:
Work:
Routes required:
Import and use helper functions for working with the database arrays on all routers:
getAllFromDatabase
getFromDatabaseById
addToDatabase
updateInstanceInDatabase
deleteFromDatabasebyId
deleteAllFromDatabase
Date
objectTake note that many values that could be numbers are in fact strings. Since we are writing an API, we can't trust that data is always provided by a client. You may need to transform between String and Number JavaScript types in order to provide full functionality in your API.
Update the components to the latest version:
/api/minions
/api/ideas
/api/meetings
For all
/api/minions
and/api/ideas routes
, any POST or PUT requests will send their new/updated resources in the request body. POST request bodies will not have anid
property, you will have to set it based on the next id in sequence.
For
/api/meetings
POST route, no request body is necessary, as meetings are generated automatically by the server upon request. Use the providedcreateMeeting
function exported from db.js to create a new meeting object.
The server is missing key functionality to allow it to run. You must:
body-parser
packagae.cors
package. You can use the default settings.apiRouter
at /api
. This router will serve as the starting point for all your API routes.PORT
. Make sure to use the PORT
constant and not a hard-coded number, as this is required for tests to run.Take note of the comments in server.js, as your code needs to fit into specific places around the existing boilerplate.
Run
$ npm run test
to test:
checkMillionDollarIdea
that will come in handy in some /api/ideas routes. Write this function in the server/checkMillionDollarIdea.js file. This function will make sure that any new or updated ideas are still worth at least one million dollars! The total value of an idea is the product of its numWeeks
and weeklyRevenue
properties.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.