Coder Social home page Coder Social logo

emptyproject-restservice's Introduction

Empty project: REST Service

Instructions:

  • install the latest version of the Total.js framework 4 from NPM $ npm install total4
  • download example
  • run $ node index.js
  • open browser http://127.0.0.1:8000

emptyproject-restservice's People

Contributors

frunjik avatar petersirka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

emptyproject-restservice's Issues

Database best practice

For this empty project, how to transform this nosql database with mongodb/mongoose purpose?
In fact, model and controller are well formed and easy to maintain (good job!). But I'm wondering to translate this with mongoose

/config

database: mongodb://<your connection string>

/controllers/users.js (no changes)

/models/user.js (??? how to proceed here? )

var mongoose = require('mongoose');
NEWSCHEMA('User').make(function(schema) {
    // how to declare schema? Is it right?
    var userSchema = mongoose.Schema({ alias: String, created: Date });
    schema = mongoose.model('user', userSchema); // setSave, setQuery, setRemove etc.: not available

    schema.setSave(function(error, model, options, callback) {
        // how to crud with our mongoose? model.save?
    });

Thank you for your help on this purpose.

wildcards * are no longer allowed by the most commons web browsers

Although the use of wildcards * should work with any current browser, the reality is that they are no longer allowed by them.

For example:
F.cors('/api/scenarios/*', ['get', 'post', 'put', 'delete'], true);
F.cors('/api/scenarios', ['get', 'post', 'put', 'delete'], true);

/api/scenarios <--- works
/api/scenarios/{id} <--- cors problems

How can I dynamically add an id to be managed at the backend side if I cannot use wildcards or asterisks for determining the url and Id?

Is there any workaround to solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.